From: Michael Haggerty Date: Mon, 17 Oct 2011 02:38:10 +0000 (+0200) Subject: write_ref_sha1(): only invalidate the loose ref cache X-Git-Tag: v1.7.8-rc0~20^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8bf90dc9bdf3fb1d2b1b2eb46293a719a3638acb;p=git.git write_ref_sha1(): only invalidate the loose ref cache Since write_ref_sha1() can only write loose refs and cannot write symbolic refs, there is no need for it to invalidate the packed ref cache. Suggested by: Martin Fick Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- diff --git a/refs.c b/refs.c index 2a21dc344..a888cea56 100644 --- a/refs.c +++ b/refs.c @@ -1534,7 +1534,7 @@ int write_ref_sha1(struct ref_lock *lock, unlock_ref(lock); return -1; } - invalidate_ref_cache(NULL); + clear_loose_ref_cache(get_ref_cache(NULL)); if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0 || (strcmp(lock->ref_name, lock->orig_ref_name) && log_ref_write(lock->orig_ref_name, lock->old_sha1, sha1, logmsg) < 0)) {