From: Christian Couder Date: Mon, 27 Feb 2017 18:00:02 +0000 (+0100) Subject: read-cache: add and then use tweak_split_index() X-Git-Tag: v2.13.0-rc0~111^2~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4392531211e48ead6bf2d27c58b208cd1e221eda?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 4392531211e48ead6bf2d27c58b208cd1e221eda diff --git a/read-cache.c b/read-cache.c index f92a912dcb..732b7fe611 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! */