Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2022-07-29 20:12:06 +0300
committerJunio C Hamano <gitster@pobox.com>2022-08-01 05:24:13 +0300
commitfef2b6dace192865f8552b54d2053cba52f31a66 (patch)
tree81422bb96e96e3c80aa050a71d8b716345a65e7c /merge-ort.c
parent359da658ae32d9a7e5e93ac173fc221352b62917 (diff)
merge-ort: clean up after failed merge
In 9fefce68dc8 (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 <johannes.schindelin@gmx.de> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-ort.c')
-rw-r--r--merge-ort.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/merge-ort.c b/merge-ort.c
index c319797021..52deb36594 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -4225,6 +4225,7 @@ void merge_switch_to_result(struct merge_options *opt,
if (checkout(opt, head, result->tree)) {
/* failure to function */
result->clean = -1;
+ merge_finalize(opt, result);
return;
}
trace2_region_leave("merge", "checkout", opt->repo);
@@ -4235,6 +4236,7 @@ void merge_switch_to_result(struct merge_options *opt,
/* failure to function */
opt->priv = NULL;
result->clean = -1;
+ merge_finalize(opt, result);
return;
}
opt->priv = NULL;