Skip to content

Commit fef2b6d

Browse files
dschogitster
authored andcommitted
merge-ort: clean up after failed merge
In 9fefce6 (merge-ort: basic outline for merge_switch_to_result(), 2020-12-13), we added functionality to lay down the result of a merge on disk. But we forgot to release the data structures in case `unpack_trees()` failed to run properly. This was pointed out by the `linux-leaks` job in our CI runs. Signed-off-by: Johannes Schindelin <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 359da65 commit fef2b6d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

merge-ort.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4225,6 +4225,7 @@ void merge_switch_to_result(struct merge_options *opt,
42254225
if (checkout(opt, head, result->tree)) {
42264226
/* failure to function */
42274227
result->clean = -1;
4228+
merge_finalize(opt, result);
42284229
return;
42294230
}
42304231
trace2_region_leave("merge", "checkout", opt->repo);
@@ -4235,6 +4236,7 @@ void merge_switch_to_result(struct merge_options *opt,
42354236
/* failure to function */
42364237
opt->priv = NULL;
42374238
result->clean = -1;
4239+
merge_finalize(opt, result);
42384240
return;
42394241
}
42404242
opt->priv = NULL;

0 commit comments

Comments
 (0)