From 419f0c0f681b76d720699977abe03d29e22db554 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Wed, 1 Oct 2014 12:28:07 +0200 Subject: close_lock_file(): exit (successfully) if file is already closed Suggested-by: Jonathan Nieder Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'read-cache.c') 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; -- cgit v1.2.3