summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-06-25 04:34:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-25 17:42:52 (GMT)
commit3ee83f48e5cfdfe2e3c783df1f3162e9383732fa (patch)
treef5848d909e6d857f6e9b6fded7179612e411821e /t
parent73de1c93adbdac279c10668afbc7ba6e48a7ccac (diff)
downloadgit-3ee83f48e5cfdfe2e3c783df1f3162e9383732fa.zip
git-3ee83f48e5cfdfe2e3c783df1f3162e9383732fa.tar.gz
git-3ee83f48e5cfdfe2e3c783df1f3162e9383732fa.tar.bz2
t1700: make sure split-index respects core.sharedrepository
Add a few tests to check that both the split-index file and the shared-index file are created using the right permissions when core.sharedrepository is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t1700-split-index.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index af3ec0d..22f69a4 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -370,4 +370,34 @@ test_expect_success 'check splitIndex.sharedIndexExpire set to "never" and "now"
test $(ls .git/sharedindex.* | wc -l) -le 2
'
+while read -r mode modebits
+do
+ test_expect_success POSIXPERM "split index respects core.sharedrepository $mode" '
+ # Remove existing shared index files
+ git config core.splitIndex false &&
+ git update-index --force-remove one &&
+ rm -f .git/sharedindex.* &&
+ # Create one new shared index file
+ git config core.sharedrepository "$mode" &&
+ git config core.splitIndex true &&
+ : >one &&
+ git update-index --add one &&
+ echo "$modebits" >expect &&
+ test_modebits .git/index >actual &&
+ test_cmp expect actual &&
+ shared=$(ls .git/sharedindex.*) &&
+ case "$shared" in
+ *" "*)
+ # we have more than one???
+ false ;;
+ *)
+ test_modebits "$shared" >actual &&
+ test_cmp expect actual ;;
+ esac
+ '
+done <<\EOF
+0666 -rw-rw-rw-
+0642 -rw-r---w-
+EOF
+
test_done