Skip to content

Commit 6481652

Browse files
Martin Ågrengitster
authored andcommitted
sequencer: always roll back lock in do_recursive_merge()
If we return early, we forget to roll back the lockfile. Do so. Signed-off-by: Martin Ågren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 14bca6c commit 6481652

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sequencer.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,10 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
514514
fputs(o.obuf.buf, stdout);
515515
strbuf_release(&o.obuf);
516516
diff_warn_rename_limit("merge.renamelimit", o.needed_rename_limit, 0);
517-
if (clean < 0)
517+
if (clean < 0) {
518+
rollback_lock_file(&index_lock);
518519
return clean;
520+
}
519521

520522
if (active_cache_changed &&
521523
write_locked_index(&the_index, &index_lock, COMMIT_LOCK))

0 commit comments

Comments
 (0)