Re: [PATCH 02/10] unpack-trees: move all skip-worktree check back to unpack_trees()

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

 



2010/11/15 Thiago Farina <tfransosi@xxxxxxxxx>:
> 2010/11/15 Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>:
>> Â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.

>
>> Â/*
>> Â* 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]