summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-10-17 04:38:10 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-16 21:12:04 -0700
commit8bf90dc9bdf3fb1d2b1b2eb46293a719a3638acb (patch)
treed7d6ae334deccfba25ee04c1625eaf862d2e7431 /refs.c
parent760c4512e54e524e3a19905c10a65209fda20c12 (diff)
downloadgit-8bf90dc9bdf3fb1d2b1b2eb46293a719a3638acb.tar.gz
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 <mfick@codeaurora.org> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/refs.c b/refs.c
index 2a21dc3443..a888cea56e 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)) {