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 test_expect_success
'update-server-info honors core.sharedRepository' '
33 git update-server-info &&
34 actual="$(ls -l .git/info/refs)" &&
40 echo Oops, .git/info/refs is not 0444
46 for u
in 0660:rw-rw---- \
52 x
=$
(expr "$u" : ".*:\([rw-]*\)") &&
53 y
=$
(echo "$x" |
sed -e "s/w/-/g") &&
54 u
=$
(expr "$u" : "\([0-7]*\)") &&
55 git config core.sharedrepository
"$u" &&
58 test_expect_success
"shared = $u ($y) ro" '
60 rm -f .git/info/refs &&
61 git update-server-info &&
62 actual="$(ls -l .git/info/refs)" &&
63 actual=${actual%% *} &&
64 test "x$actual" = "x-$y" || {
71 test_expect_success
"shared = $u ($x) rw" '
73 rm -f .git/info/refs &&
74 git update-server-info &&
75 actual="$(ls -l .git/info/refs)" &&
76 actual=${actual%% *} &&
77 test "x$actual" = "x-$x" || {