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:
authorJunio C Hamano <gitster@pobox.com>2018-02-14 00:39:14 +0300
committerJunio C Hamano <gitster@pobox.com>2018-02-14 00:39:14 +0300
commitdd0c256b67d1b128655c42ae126fa3397b1f9ede (patch)
treea2c7abcf6d0ccc8a89f2185070343d6402a4b7f4 /t/t1700-split-index.sh
parent39a1dd80f8e9542603904bdf2e62d140a88c7e38 (diff)
parentef5b3a6c5e24c54ba4436e225b9431c63ab163f0 (diff)
Merge branch 'nd/shared-index-fix'
Code clean-up. * nd/shared-index-fix: read-cache: don't write index twice if we can't write shared index read-cache.c: move tempfile creation/cleanup out of write_shared_index read-cache.c: change type of "temp" in write_shared_index()
Diffstat (limited to 't/t1700-split-index.sh')
-rwxr-xr-xt/t1700-split-index.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index c087b63367..a66936fe9b 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -401,6 +401,25 @@ done <<\EOF
0642 -rw-r---w-
EOF
+test_expect_success POSIXPERM,SANITY 'graceful handling when splitting index is not allowed' '
+ test_create_repo ro &&
+ (
+ cd ro &&
+ test_commit initial &&
+ git update-index --split-index &&
+ test -f .git/sharedindex.*
+ ) &&
+ cp ro/.git/index new-index &&
+ test_when_finished "chmod u+w ro/.git" &&
+ chmod u-w ro/.git &&
+ GIT_INDEX_FILE="$(pwd)/new-index" git -C ro update-index --split-index &&
+ chmod u+w ro/.git &&
+ rm ro/.git/sharedindex.* &&
+ GIT_INDEX_FILE=new-index git ls-files >actual &&
+ echo initial.t >expected &&
+ test_cmp expected actual
+'
+
test_expect_success 'writing split index with null sha1 does not write cache tree' '
git config core.splitIndex true &&
git config splitIndex.maxPercentChange 0 &&