1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 23:06:12 +02:00

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 <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Martin Ågren 2018-02-27 22:30:10 +01:00 committed by Junio C Hamano
parent 14bca6c63c
commit 6481652432

View File

@ -514,8 +514,10 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
fputs(o.obuf.buf, stdout);
strbuf_release(&o.obuf);
diff_warn_rename_limit("merge.renamelimit", o.needed_rename_limit, 0);
if (clean < 0)
if (clean < 0) {
rollback_lock_file(&index_lock);
return clean;
}
if (active_cache_changed &&
write_locked_index(&the_index, &index_lock, COMMIT_LOCK))