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>
This commit is contained in:

committed by
Junio C Hamano

parent
a5e48669a2
commit
419f0c0f68
@ -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;
|
||||
|
Reference in New Issue
Block a user