Skip to content

Commit 95508a0

Browse files
peffgitster
authored andcommitted
t1301: use modern test_* helpers
This shortens the code and fixes some &&-chaining. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 9157c5c commit 95508a0

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

t/t1301-shared-repo.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ setfacl -k . 2>/dev/null
1212

1313
# User must have read permissions to the repo -> failure on --shared=0400
1414
test_expect_success 'shared = 0400 (faulty permission u-w)' '
15+
test_when_finished "rm -rf sub" &&
1516
mkdir sub && (
16-
cd sub && git init --shared=0400
17+
cd sub &&
18+
test_must_fail git init --shared=0400
1719
)
18-
ret="$?"
19-
rm -rf sub
20-
test $ret != "0"
2120
'
2221

2322
modebits () {
@@ -33,7 +32,7 @@ do
3332
git init --shared=1 &&
3433
test 1 = "$(git config core.sharedrepository)"
3534
) &&
36-
actual=$(ls -l sub/.git/HEAD)
35+
actual=$(ls -l sub/.git/HEAD) &&
3736
case "$actual" in
3837
-rw-rw-r--*)
3938
: happy
@@ -90,10 +89,8 @@ do
9089
rm -f .git/info/refs &&
9190
git update-server-info &&
9291
actual="$(modebits .git/info/refs)" &&
93-
test "x$actual" = "x-$y" || {
94-
ls -lt .git/info
95-
false
96-
}
92+
verbose test "x$actual" = "x-$y"
93+
9794
'
9895

9996
umask 077 &&
@@ -102,10 +99,7 @@ do
10299
rm -f .git/info/refs &&
103100
git update-server-info &&
104101
actual="$(modebits .git/info/refs)" &&
105-
test "x$actual" = "x-$x" || {
106-
ls -lt .git/info
107-
false
108-
}
102+
verbose test "x$actual" = "x-$x"
109103
110104
'
111105

0 commit comments

Comments
 (0)