Signed-off-by: Christian Couder <chrisc...@tuxfamily.org>
---
 t/t1700-split-index.sh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index 507a1dd1ad..f03addf654 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -238,4 +238,76 @@ EOF
        test_cmp expect actual
 '
 
+test_expect_success 'set core.splitIndex config variable to true' '
+       git config core.splitIndex true &&
+       : >three &&
+       git update-index --add three &&
+       BASE=$(test-dump-split-index .git/index | grep "^base") &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+replacements:
+deletions:
+EOF
+       test_cmp expect actual &&
+       : >four &&
+       git update-index --add four &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0      four
+replacements:
+deletions:
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'check behavior with splitIndex.maxPercentChange unset' '
+       git config --unset splitIndex.maxPercentChange &&
+       : >five &&
+       git update-index --add five &&
+       BASE=$(test-dump-split-index .git/index | grep "^base") &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+replacements:
+deletions:
+EOF
+       test_cmp expect actual &&
+       : >six &&
+       git update-index --add six &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0      six
+replacements:
+deletions:
+EOF
+       test_cmp expect actual
+'
+
+test_expect_success 'check splitIndex.maxPercentChange set to 0' '
+       git config splitIndex.maxPercentChange 0 &&
+       : >seven &&
+       git update-index --add seven &&
+       BASE=$(test-dump-split-index .git/index | grep "^base") &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+replacements:
+deletions:
+EOF
+       test_cmp expect actual &&
+       : >eight &&
+       git update-index --add eight &&
+       BASE=$(test-dump-split-index .git/index | grep "^base") &&
+       test-dump-split-index .git/index | sed "/^own/d" >actual &&
+       cat >expect <<EOF &&
+$BASE
+replacements:
+deletions:
+EOF
+       test_cmp expect actual
+'
+
 test_done
-- 
2.11.0.49.g2414764.dirty

Reply via email to