From: René Scharfe Date: Wed, 14 Aug 2019 04:30:50 GMT Subject: Re: [RFC PATCH] unpack-trees.c: handle empty deleted ita files Message-ID: <22b814f7-4b71-aa68-3078-9cc40338a37d@web.de> In-Reply-To: Am 13.08.19 um 22:32 schrieb Junio C Hamano: > 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);