Re: [PATCH 03/32] cache-tree: ignore CE_REMOVE entries in verify_cache()
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Aug 25, 2010, 00:23 UTC
- Message-ID
- <AANLkTi=P-PoBWwDbfGs7v1BTwvJ7uwfe7hd7A+Y7M361@mail.gmail.com>
- In-Reply-To
- <20100824231536.GE2376@burratino>
On Wed, Aug 25, 2010 at 9:15 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 18 quoted lines
> Nguyễn Thái Ngọc Duy wrote:
>
>> --- a/cache-tree.c
>> +++ b/cache-tree.c
>> @@ -156,6 +156,8 @@ static int verify_cache(struct cache_entry **cache,
>> funny = 0;
>> for (i = 0; i < entries; i++) {
>> struct cache_entry *ce = cache[i];
>> + if (ce->ce_flags & CE_REMOVE)
>> + continue;
>> if (ce_stage(ce) || (ce->ce_flags & CE_INTENT_TO_ADD)) {
>> if (10 < ++funny) {
>> fprintf(stderr, "...\n");
>
> In other words, this teaches internal write-tree callers to ignore
> unmerged and intent-to-add entries marked with CE_REMOVE.
>
> Why? When does this come up?I was lazy. In patch 26, upload-narrow-merge do three way merge and drop staged entries within narrow tree (this is at server side, conflicts within narrow tree will be handled at client side later). Instead of removing staged entries, I mark them CE_REMOVE.
-- Duy