All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>,
	Johannes Schindelin <johannes.schindelin@gmx.de>,
	Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH] merge-ort: clean up after failed merge
Date: Fri, 29 Jul 2022 08:52:27 +0000	[thread overview]
Message-ID: <pull.1307.git.1659084748350.gitgitgadget@gmail.com> (raw)

From: Johannes Schindelin <johannes.schindelin@gmx.de>

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>
---
    merge-ort: clean up after failed merge
    
    I was investigating why seen's CI runs fail, and came up with this fix.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1307%2Fdscho%2Fmerge-ort-impl-leakfix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1307/dscho/merge-ort-impl-leakfix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1307

 merge-ort.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/merge-ort.c b/merge-ort.c
index ee7fbe71404..61b9e90018b 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -1002,6 +1002,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;
 		}
 
@@ -1010,6 +1011,7 @@ void merge_switch_to_result(struct merge_options *opt,
 						    &opti->conflicted)) {
 			/* failure to function */
 			result->clean = -1;
+			merge_finalize(opt, result);
 			return;
 		}
 	}

base-commit: 9fefce68dc85d96781090f86c067d83f7c50b617
-- 
gitgitgadget

             reply	other threads:[~2022-07-29  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29  8:52 Johannes Schindelin via GitGitGadget [this message]
2022-07-29 15:31 ` [PATCH] merge-ort: clean up after failed merge Elijah Newren
2022-07-29 17:12 ` [PATCH v2 0/2] " Johannes Schindelin via GitGitGadget
2022-07-29 17:12   ` [PATCH v2 1/2] " Johannes Schindelin via GitGitGadget
2022-07-29 17:12   ` [PATCH v2 2/2] merge-ort: do leave Trace2 region even if checkout fails Johannes Schindelin via GitGitGadget
2022-07-30  0:50   ` [PATCH v2 0/2] merge-ort: clean up after failed merge Elijah Newren
2022-07-31 18:44     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1307.git.1659084748350.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=newren@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.