From: "René Scharfe" <l.s.r@web.de>
To: Varun Naik <vcnaik94@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com
Subject: Re: [PATCH v2] unpack-trees.c: distinguish ita files from empty files
Date: Thu, 15 Aug 2019 18:46:29 +0200 [thread overview]
Message-ID: <a19fd436-b5f3-462f-6f9b-f8eeb46c78da@web.de> (raw)
In-Reply-To: <20190815162115.65008-1-vcnaik94@gmail.com>
Am 15.08.19 um 18:21 schrieb Varun Naik:
> diff --git a/unpack-trees.c b/unpack-trees.c
> index 50189909b8..5e6d88f36b 100644
> --- a/unpack-trees.c
> +++ b/unpack-trees.c
> @@ -1658,9 +1658,10 @@ 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;
If any of the two entries has the intent-to-add flag set, they won't be
considered the same and we exit early.
> return a->ce_mode == b->ce_mode &&
> + !ce_intent_to_add(a) == !ce_intent_to_add(b) &&
So if we reach this point, the flag can't be set, ce_intent_to_add()
returns 0 on both sides and thus the added condition is always true.
You might as well remove it.
> oideq(&a->oid, &b->oid);
> }
>
>
next prev parent reply other threads:[~2019-08-15 16:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 16:03 [RFC PATCH] unpack-trees.c: handle empty deleted ita files Varun Naik
2019-08-13 18:08 ` René Scharfe
2019-08-13 20:32 ` Junio C Hamano
2019-08-14 4:30 ` René Scharfe
2019-08-15 16:17 ` Varun Naik
2019-08-15 16:34 ` Junio C Hamano
2019-08-19 15:35 ` Varun Naik
2019-08-19 19:54 ` Junio C Hamano
2019-08-15 16:21 ` [PATCH v2] unpack-trees.c: distinguish ita files from empty files Varun Naik
2019-08-15 16:46 ` René Scharfe [this message]
2019-08-21 3:21 ` [PATCH v3] " Varun Naik
2020-02-14 17:14 ` [PATCH v4] " Varun Naik
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a19fd436-b5f3-462f-6f9b-f8eeb46c78da@web.de \
--to=l.s.r@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=vcnaik94@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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).