summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-02-27 18:00:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-03-01 21:24:21 (GMT)
commit4392531211e48ead6bf2d27c58b208cd1e221eda (patch)
tree594216da4b591ce5979561ba0c5a8806e42ab7ec /read-cache.c
parentcef4fc7ebe869e910d0fd5643cd60328ed76356a (diff)
downloadgit-4392531211e48ead6bf2d27c58b208cd1e221eda.zip
git-4392531211e48ead6bf2d27c58b208cd1e221eda.tar.gz
git-4392531211e48ead6bf2d27c58b208cd1e221eda.tar.bz2
read-cache: add and then use tweak_split_index()
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>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index f92a912..732b7fe 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -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! */