]> git.ipfire.org Git - thirdparty/git.git/commit - refs/files-backend.c
lock_ref_for_update(): don't re-read non-symbolic references
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 25 Apr 2016 15:38:35 +0000 (17:38 +0200)
committerMichael Haggerty <mhagger@alum.mit.edu>
Mon, 13 Jun 2016 09:23:50 +0000 (11:23 +0200)
commit8169d0d06ad721aa54d95f044f4b097d79151ea2
treecad95d43a435cd31887ebf710e68969aeca234e9
parent92b1551b1d407065f961ffd1d972481063a0edcc
lock_ref_for_update(): don't re-read non-symbolic references

Before the previous patch, our first read of the reference happened
before the reference was locked, so we couldn't trust its value and had
to read it again. But now that our first read of the reference happens
after acquiring the lock, there is no need to read it a second time. So
move the read_ref_full() call into the (update->type & REF_ISSYMREF)
block.

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