Re: [PATCH v2] unpack-trees.c: distinguish ita files from empty files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
>  }
>
>




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux