summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2014-10-01 12:28:07 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-10-01 13:38:39 -0700
commit419f0c0f681b76d720699977abe03d29e22db554 (patch)
treefe326a207ecc55c8103f28a07617eb542411427f /read-cache.c
parentapi-lockfile: revise and expand the documentation (diff)
downloadtgif-419f0c0f681b76d720699977abe03d29e22db554.tar.xz
close_lock_file(): exit (successfully) if file is already closed
Suggested-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 2fc1182f22..5ffb1d7bb6 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2042,7 +2042,7 @@ void set_alternate_index_output(const char *name)
static int commit_locked_index(struct lock_file *lk)
{
if (alternate_index_output) {
- if (lk->fd >= 0 && close_lock_file(lk))
+ if (close_lock_file(lk))
return -1;
if (rename(lk->filename, alternate_index_output))
return -1;