Thread (17 messages) 17 messages, 3 authors, 2016-06-15

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

flat view

From: Duy Nguyen <hidden>
Date: 2016-06-15 23:07:51

On Wed, Jan 20, 2016 at 4:59 PM, Christian Couder
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help