Skip to content

Commit

Permalink
read-cache: add and then use tweak_split_index()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
chriscool authored and gitster committed Mar 1, 2017
1 parent cef4fc7 commit 4392531
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions read-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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! */
Expand Down

0 comments on commit 4392531

Please sign in to comment.