lock_ref_for_update(): make error handling more uniform
authorMichael Haggerty <mhagger@alum.mit.edu>
Tue, 7 Jun 2016 07:29:23 +0000 (09:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jun 2016 18:49:00 +0000 (11:49 -0700)
commite3f510393c9d373f2969badc2b8afe179803a0fa
tree57c2b89dbd15141a4389ad0c463c28a9762c1d28
parentc5119dcf493a7b13b6a3e586e8d771a9e1d4975e
lock_ref_for_update(): make error handling more uniform

To aid the effort, extract a new function, check_old_oid(), and use it
in the two places where the read value of the reference has to be
checked against update->old_sha1.

Update tests to reflect the improvements.

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