From: Thiago Farina Date: Mon, 15 Nov 2010 12:34:31 GMT Subject: Re: [PATCH 02/10] unpack-trees: move all skip-worktree check back to unpack_trees() Message-ID: In-Reply-To: <1289817410-32470-3-git-send-email-pclouds@gmail.com> 2010/11/15 Nguyễn Thái Ngọc Duy : >  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? >  /* >  * 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.