Skip to content

Commit 8bf90dc

Browse files
mhaggergitster
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 760c451 commit 8bf90dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ int write_ref_sha1(struct ref_lock *lock,
15341534
unlock_ref(lock);
15351535
return -1;
15361536
}
1537-
invalidate_ref_cache(NULL);
1537+
clear_loose_ref_cache(get_ref_cache(NULL));
15381538
if (log_ref_write(lock->ref_name, lock->old_sha1, sha1, logmsg) < 0 ||
15391539
(strcmp(lock->ref_name, lock->orig_ref_name) &&
15401540
log_ref_write(lock->orig_ref_name, lock->old_sha1, sha1, logmsg) < 0)) {

0 commit comments

Comments
 (0)