If we return early, we forget to roll back the lockfile. Do so. Signed-off-by: Martin Ågren <martin.agren@xxxxxxxxx> --- merge-recursive.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/merge-recursive.c b/merge-recursive.c index cc5fa0a949..7345125691 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -2198,8 +2198,10 @@ int merge_recursive_generic(struct merge_options *o, hold_locked_index(&lock, LOCK_DIE_ON_ERROR); clean = merge_recursive(o, head_commit, next_commit, ca, result); - if (clean < 0) + if (clean < 0) { + rollback_lock_file(&lock); return clean; + } if (active_cache_changed && write_locked_index(&the_index, &lock, COMMIT_LOCK)) -- 2.16.2.246.ga4ee44448f