]> git.ipfire.org Git - thirdparty/git.git/commit
expire_reflog(): use a lock_file for rewriting the reflog file
authorMichael Haggerty <mhagger@alum.mit.edu>
Fri, 12 Dec 2014 08:56:46 +0000 (09:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Dec 2014 19:43:47 +0000 (11:43 -0800)
commitf3b661f766c1525265d065fdd0529985979c80c6
treeef98df2fc03daee9e9c897ae8eba40358eea3b68
parent2e376b3156ff30dcd359b7c424fcbdbab5ec7709
expire_reflog(): use a lock_file for rewriting the reflog file

We don't actually need the locking functionality, because we already
hold the lock on the reference itself, which is how the reflog file is
locked. But the lock_file code can do some of the bookkeeping for us,
and it is more careful than the old code here was. For example:

* It correctly handles the case that the reflog lock file already
  exists for some reason or cannot be opened.

* It correctly cleans up the lockfile if the program dies.

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