lock_ref_for_update(): avoid a symref resolution
commit841caad903f2b160e9f5ff05f961d20ad9085ddc
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 7 Jun 2016 07:32:08 +0000 (7 09:32 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jun 2016 18:49:00 +0000 (20 11:49 -0700)
tree524afe94d06cefcf32c5d64b760615105127faff
parente3f510393c9d373f2969badc2b8afe179803a0fa
lock_ref_for_update(): avoid a symref resolution

If we're overwriting a symref with a SHA-1, we need to resolve the value
of the symref (1) to check against update->old_sha1 and (2) to write to
its reflog. However, we've already read the symref itself and know its
referent. So there is no need to read the symref's value through the
symref; we can read the referent directly.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/files-backend.c