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

Re: [RFC PATCH] unpack-trees.c: handle empty deleted ita files

From
René Scharfe <l.s.r@web.de>
Date
Aug 14, 2019, 04:30 UTC
Message-ID
<22b814f7-4b71-aa68-3078-9cc40338a37d@web.de>
In-Reply-To
<xmqqr25o7qmf.fsf@gitster-ct.c.googlers.com>
Am 13.08.19 um 22:32 schrieb Junio C Hamano:
Show 6 quoted lines
> So perhaps
>
> +	!ce_intent_to_add(a) && !ce_intent_to_add(b) &&
>
> i.e. "a cache entry is eligible to be same with something else only
> when its I-T-A bit is unset".
FWIW, here's another way to express that:
diff --git a/unpack-trees.c b/unpack-trees.c
index 62276d4fef..a62d67d131 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1658,7 +1658,7 @@ static int same(const struct cache_entry *a, const struct cache_entry *b)
 		return 0;
 	if (!a && !b)
 		return 1;
-	if ((a->ce_flags | b->ce_flags) & CE_CONFLICTED)
+	if ((a->ce_flags | b->ce_flags) & (CE_CONFLICTED | CE_INTENT_TO_ADD))
 		return 0;
 	return a->ce_mode == b->ce_mode &&
 	       oideq(&a->oid, &b->oid);
Previous: Junio C HamanoNext: Varun Naik
Message 4 of 12 in “unpack-trees.c: handle empty deleted ita files”
  1. unpack-trees.c: handle empty deleted ita filesVarun Naik, Aug 13, 2019
  2. René ScharfeAug 13, 2019
  3. Junio C HamanoAug 13, 2019
  4. René ScharfeAug 14, 2019
  5. Varun NaikAug 15, 2019
  6. Junio C HamanoAug 15, 2019
  7. Varun NaikAug 19, 2019
  8. Junio C HamanoAug 19, 2019
  9. unpack-trees.c: distinguish ita files from empty filesVarun Naik, Aug 15, 2019
  10. René ScharfeAug 15, 2019
  11. unpack-trees.c: distinguish ita files from empty filesVarun Naik, Aug 21, 2019
  12. unpack-trees.c: distinguish ita files from empty filesVarun Naik, Feb 14, 2020

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.