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>
Michael Haggerty committed
Oct 17, 2011 at 04:38 UTC
8bf90dc9bdf3fb1d2b1b2eb46293a719a3638acb
1 file changed
+1
-1
refs.c
+1
-1
@@ -1534,7 +1534,7 @@ int write_ref_sha1(struct ref_lock *lock,
1534
unlock_ref(lock);
1535
return -1;
1536
}
1537
- invalidate_ref_cache(NULL);
1537
+ clear_loose_ref_cache(get_ref_cache(NULL));
1538
if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0 ||
1539
(strcmp(lock->ref_name, lock->orig_ref_name) &&
1540
log_ref_write(lock->orig_ref_name, lock->old_sha1, sha1, logmsg) < 0)) {