Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-02-27 21:00:04 +0300
committerJunio C Hamano <gitster@pobox.com>2017-03-02 00:24:21 +0300
commitb8923bf611aab737f0d1fbc32ff3131d72364550 (patch)
tree1175f21594896000eb1b09fbb84bc37c43e6cf80 /t/t1700-split-index.sh
parent6cc1053375d8e138b8f05dde4cd0d4ab8f92254a (diff)
t1700: add tests for core.splitIndex
Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1700-split-index.sh')
-rwxr-xr-xt/t1700-split-index.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index cb68b8dc1e..1659986d8d 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -200,4 +200,41 @@ test_expect_success 'unify index, two files remain' '
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 &&
+ git ls-files --stage >ls-files.actual &&
+ cat >ls-files.expect <<-EOF &&
+ 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 one
+ 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 three
+ 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 two
+ EOF
+ test_cmp ls-files.expect ls-files.actual &&
+ 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_expect_success 'set core.splitIndex config variable to false' '
+ git config core.splitIndex false &&
+ git update-index --force-remove three &&
+ git ls-files --stage >ls-files.actual &&
+ cat >ls-files.expect <<-EOF &&
+ 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 one
+ 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 two
+ EOF
+ test_cmp ls-files.expect ls-files.actual &&
+ test-dump-split-index .git/index | sed "/^own/d" >actual &&
+ cat >expect <<-EOF &&
+ not a split index
+ EOF
+ test_cmp expect actual
+'
+
test_done