3 # Copyright (c) 2007 Johannes Schindelin
6 test_description
='Test shared repository initialization'
10 # User must have read permissions to the repo -> failure on --shared=0400
11 test_expect_success
'shared = 0400 (faulty permission u-w)' '
13 cd sub && git init --shared=0400
20 test_expect_success
'shared=all' '
23 git init --shared=all &&
24 test 2 = $(git config core.sharedrepository)
27 say
"update-server-info not supported - skipping tests"
31 test_expect_success
'update-server-info honors core.sharedRepository' '
37 git update-server-info &&
38 actual="$(ls -l .git/info/refs)" &&
44 echo Oops, .git/info/refs is not 0444
50 for u
in 0660:rw-rw---- \
56 x
=$
(expr "$u" : ".*:\([rw-]*\)") &&
57 y
=$
(echo "$x" |
sed -e "s/w/-/g") &&
58 u
=$
(expr "$u" : "\([0-7]*\)") &&
59 git config core.sharedrepository
"$u" &&
62 test_expect_success
"shared = $u ($y) ro" '
64 rm -f .git/info/refs &&
65 git update-server-info &&
66 actual="$(ls -l .git/info/refs)" &&
67 actual=${actual%% *} &&
68 test "x$actual" = "x-$y" || {
75 test_expect_success
"shared = $u ($x) rw" '
77 rm -f .git/info/refs &&
78 git update-server-info &&
79 actual="$(ls -l .git/info/refs)" &&
80 actual=${actual%% *} &&
81 test "x$actual" = "x-$x" || {