From: Duy Nguyen Date: Sat, 23 Jan 2016 00:50:37 GMT Subject: Re: [PATCH v6 09/11] config: add core.untrackedCache Message-ID: In-Reply-To: <1453283984-8979-10-git-send-email-chriscool@tuxfamily.org> On Wed, Jan 20, 2016 at 4:59 PM, Christian Couder wrote: > diff --git a/read-cache.c b/read-cache.c > index 84616c8..1d5696c 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -1622,6 +1622,20 @@ int read_index_from(struct index_state *istate, const char *path) > return istate->cache_nr; > > ret = do_read_index(istate, path, 0); > + > + switch (git_config_get_untracked_cache()) { > + case -1: /* keep: do nothing */ > + break; > + case 0: /* false */ > + remove_untracked_cache(istate); > + break; > + case 1: /* true */ > + add_untracked_cache(istate); > + break; > + default: /* unknown value: do nothing */ > + break; > + } > + It would be safer to do this after a split index is merged. That is, after merge_base_index() in this function. It's not wrong, because uc can't be in the base index. But who knows what people will do in the future. Because there are two exits in this function, maybe you can rename check_ce_order() to post_read_index_from() and do this check there too. > split_index = istate->split_index; > if (!split_index || is_null_sha1(split_index->base_sha1)) { > check_ce_order(istate); -- Duy