]> git.ipfire.org Git - thirdparty/git.git/commitdiff
read-cache: add and then use tweak_split_index()
authorChristian Couder <christian.couder@gmail.com>
Mon, 27 Feb 2017 18:00:02 +0000 (19:00 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Mar 2017 21:24:21 +0000 (13:24 -0800)
This will make us use the split-index feature or not depending
on the value of the "core.splitIndex" config variable.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c

index f92a912dcb224b3f6da9e9be07a33cfe3b08edcc..732b7fe6113dfd8ca71be1fa00a4dd4b27f23f08 100644 (file)
@@ -1566,10 +1566,27 @@ static void tweak_untracked_cache(struct index_state *istate)
        }
 }
 
+static void tweak_split_index(struct index_state *istate)
+{
+       switch (git_config_get_split_index()) {
+       case -1: /* unset: do nothing */
+               break;
+       case 0: /* false */
+               remove_split_index(istate);
+               break;
+       case 1: /* true */
+               add_split_index(istate);
+               break;
+       default: /* unknown value: do nothing */
+               break;
+       }
+}
+
 static void post_read_index_from(struct index_state *istate)
 {
        check_ce_order(istate);
        tweak_untracked_cache(istate);
+       tweak_split_index(istate);
 }
 
 /* remember to discard_cache() before reading a different cache! */