This would trigger in the unlikely event that we are compacting, and
the next available file handle is 0.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Han-Wen Nienhuys3 years agocommitted byJunio C Hamano
@ -877,7 +877,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
@@ -877,7 +877,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
struct strbuf new_table_path = STRBUF_INIT;
int err = 0;
int have_lock = 0;
int lock_file_fd = 0;
int lock_file_fd = -1;
int compact_count = last - first + 1;
char **listp = NULL;
char **delete_on_success =
@ -911,7 +911,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
@@ -911,7 +911,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
}
/* Don't want to write to the lock for now. */
close(lock_file_fd);
lock_file_fd = 0;
lock_file_fd = -1;
have_lock = 1;
err = stack_uptodate(st);
@ -1013,7 +1013,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,
@@ -1013,7 +1013,7 @@ static int stack_compact_range(struct reftable_stack *st, int first, int last,