diff: --color-moved: rename "dimmed_zebra" to "dimmed-zebra"
[gitweb.git] / t / t1700-split-index.sh
index 322721dd646b408fdb4c63d9a91427769a44608a..a66936fe9bde2ba20ab0e57400b6286b0710212a 100755 (executable)
@@ -6,6 +6,7 @@ test_description='split index mode tests'
 
 # We need total control of index splitting here
 sane_unset GIT_TEST_SPLIT_INDEX
+sane_unset GIT_FSMONITOR_TEST
 
 test_expect_success 'enable split index' '
        git config splitIndex.maxPercentChange 100 &&
@@ -400,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 &&