Re: [PATCH 02/10] unpack-trees: move all skip-worktree check back to unpack_trees()
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Nov 16, 2010, 02:19 UTC
- Message-ID
- <AANLkTimO2fZ13BEL51GVTOChkzAD+jLm5HWAuc-+Rutc@mail.gmail.com>
- In-Reply-To
- <AANLkTi=cvt2W1Eqj7KmtM+ng-BS7wRTM=+49gq5n+ghs@mail.gmail.com>
2010/11/15 Thiago Farina <tfransosi@gmail.com>:
Show 16 quoted lines
> 2010/11/15 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
>> cache.h | 1 +
>> unpack-trees.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++-----
>> 2 files changed, 63 insertions(+), 7 deletions(-)
>>
>> diff --git a/cache.h b/cache.h
>> index 33decd9..d87708a 100644
>> --- a/cache.h
>> +++ b/cache.h
>> @@ -182,6 +182,7 @@ struct cache_entry {
>> #define CE_WT_REMOVE (0x400000) /* remove in work directory */
>>
>> #define CE_UNPACKED (0x1000000)
>> +#define CE_NEW_SKIP_WORKTREE (0x2000000)
>>
> Would be good to remove the () around the hex here and else in this file?That was the tradition of CE_*. I don't know why () is there. Will do a preparation patch to remove all () first.
Show 28 quoted lines
>
>> /*
>> * Extended on-disk flags
>> diff --git a/unpack-trees.c b/unpack-trees.c
>> index 803445a..9acd9be 100644
>> --- a/unpack-trees.c
>> +++ b/unpack-trees.c
>> @@ -258,7 +258,7 @@ static int apply_sparse_checkout(struct cache_entry *ce, struct unpack_trees_opt
>> {
>> int was_skip_worktree = ce_skip_worktree(ce);
>>
>> - if (!ce_stage(ce) && will_have_skip_worktree(ce, o))
>> + if (ce->ce_flags & CE_NEW_SKIP_WORKTREE)
>> ce->ce_flags |= CE_SKIP_WORKTREE;
>> else
>> ce->ce_flags &= ~CE_SKIP_WORKTREE;
>> @@ -834,6 +834,49 @@ static int unpack_callback(int n, unsigned long mask, unsigned long dirmask, str
>> return mask;
>> }
>>
>> +static void set_new_skip_worktree_1(struct unpack_trees_options *o)
>> +{
>> + int i;
>> +
>> + for (i = 0;i < o->src_index->cache_nr;i++) {
> Could you add spaces after ; for readability, please? There is another
> for below that needs this to.
>Yes. I kept reminding myself of doing that, then forgot.
-- Duy