On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder
<[email protected]> wrote:
> @@ -2233,7 +2263,8 @@ int write_locked_index(struct index_state *istate,
> struct lock_file *lock,
> if ((v & 15) < 6)
> istate->cache_changed |= SPLIT_INDEX_ORDERED;
> }
> - if (istate->cache_changed & SPLIT_INDEX_ORDERED) {
> + if (istate->cache_changed & SPLIT_INDEX_ORDERED ||
> + too_many_not_shared_entries(istate)) {
It's probably safer to keep this piece unchanged and add this
somewhere before it
if (too_many_not_shared_entries(istate))
istate->cache_changed |= SPLIT_INDEX_ORDERED;
We could keep cache_changed consistent until the end this way.
> int ret = write_shared_index(istate, lock, flags);
> if (ret)
> return ret;
> diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
> index db8c39f..507a1dd 100755
> --- a/t/t1700-split-index.sh
> +++ b/t/t1700-split-index.sh
> @@ -8,6 +8,7 @@ test_description='split index mode tests'
> sane_unset GIT_TEST_SPLIT_INDEX
>
> test_expect_success 'enable split index' '
> + git config splitIndex.maxPercentChange 100 &&
An alternative name might be splitThreshold. I don't know, maybe
maxPercentChange is better.
> git update-index --split-index &&
> test-dump-split-index .git/index >actual &&
> indexversion=$(test-index-version <.git/index) &&
> --
> 2.10.1.462.g7e1e03a
>
--
Duy