lock_ref_sha1_basic(): only handle REF_NODEREF mode
commit7a418f3a17b95746eb94cfd55f4fe0385d058777
authorMichael Haggerty <mhagger@alum.mit.edu>
Fri, 22 Apr 2016 13:25:25 +0000 (22 15:25 +0200)
committerMichael Haggerty <mhagger@alum.mit.edu>
Mon, 13 Jun 2016 09:23:50 +0000 (13 11:23 +0200)
tree9fa9b8766e10e0541e4d8970282bbe97f284cdd7
parent5d9b2de4ef5a6b0cc38bbb3affcc614a66c663d7
lock_ref_sha1_basic(): only handle REF_NODEREF mode

Now lock_ref_sha1_basic() is only called with flags==REF_NODEREF. So we
don't have to handle other cases anymore.

This enables several simplifications, the most interesting of which come
from the fact that ref_lock::orig_ref_name is now always the same as
ref_lock::ref_name:

* Remove ref_lock::orig_ref_name
* Remove local variable orig_refname from lock_ref_sha1_basic()
* ref_name can be initialize once and its value reused
* commit_ref_update() never has to write to the reflog for
  lock->orig_ref_name

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
refs/files-backend.c