update_ref(): don't read old reference value before delete
commita1c9eb918b9af809d75ee3206e684f3a8f29ee63
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 22 Jun 2015 14:03:08 +0000 (22 16:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Jun 2015 20:17:13 +0000 (22 13:17 -0700)
tree471a0acc3474c24730cf7478b5ef3a36171b3a91
parent4eaa4bd800152f20a51e25176a0803d1b7757c7b
update_ref(): don't read old reference value before delete

If we are deleting the reference, then we don't need to read the
reference's old value. It doesn't provide any race safety, because the
value read just before the delete is no "better" than the value that
would be read under lock during the delete. And even if the reference
previously didn't exist, we can call delete_ref() on it if we don't
provide an old_sha1 value.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fast-import.c