Skip to content

Commit 128f77f

Browse files
committed
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]>
1 parent 9fefce6 commit 128f77f

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
@@ -1002,6 +1002,7 @@ void merge_switch_to_result(struct merge_options *opt,
10021002
if (checkout(opt, head, result->tree)) {
10031003
/* failure to function */
10041004
result->clean = -1;
1005+
merge_finalize(opt, result);
10051006
return;
10061007
}
10071008

@@ -1010,6 +1011,7 @@ void merge_switch_to_result(struct merge_options *opt,
10101011
&opti->conflicted)) {
10111012
/* failure to function */
10121013
result->clean = -1;
1014+
merge_finalize(opt, result);
10131015
return;
10141016
}
10151017
}

0 commit comments

Comments
 (0)