Re: [PATCH v6 09/11] config: add core.untrackedCache

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

 



On Wed, Jan 20, 2016 at 4:59 PM, Christian Couder
<christian.couder@xxxxxxxxx> 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
--
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]