git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Post 1.7.10 cycle

From
René Scharfe <rene.scharfe@lsrfire.ath.cx>
Date
Apr 10, 2012, 18:55 UTC
Message-ID
<4F84823E.6030308@lsrfire.ath.cx>
In-Reply-To
<7v1unwtp02.fsf@alter.siamese.dyndns.org>
Am 10.04.2012 02:22, schrieb Junio C Hamano:
Show 9 quoted lines
> It's now time to pick among the topics that have been cooking in 'next'
> and 'pu' which ones to start moving to 'master' in what order.
> 
> I've already kicked one topic out of 'next' as it regresses the http proxy
> support, but I haven't spent enough time to look at the other topics again
> closely enough to decide.  I was hoping that we could feed a handful of
> topics every few days to 'master'.
> 
> I think the following topics (in 'next') are more or less ready:
> rs/unpack-trees-leakfix

Please apply the following patch before this one. It makes sure that it is a pure leak fix. Without the added check, it'd change the behaviour slightly: with o->merge == 0, we'd call mark_ce_used() on src[0]; before it would point to the leaked version, but after the patch it points to the version that has been added using do_add_entry(). Not sure if this can lead to any user-visible consequences, but this is cleaner.

-- >8 --
Subject: unpack-trees: don't perform any index operation if we're not merging

src[0] points to the index entry in the merge case and to the first tree to unpack in the non-merge case. We only want to mark the index entry, so check first if we're merging.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
---
 unpack-trees.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index 7c9ecf6..60b728e 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -772,7 +772,7 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
 	if (unpack_nondirectories(n, mask, dirmask, src, names, info) < 0)
 		return -1;
 
-	if (src[0]) {
+	if (o->merge && src[0]) {
 		if (ce_stage(src[0]))
 			mark_ce_used_same_name(src[0], o);
 		else
-- 
1.7.10
Previous: Junio C Hamano
Message 2 of 2 in “Post 1.7.10 cycle”
  1. Junio C HamanoApr 10, 2012
  2. René ScharfeApr 10, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.