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>

Jeff King committed Mar 20, 2015 at 06:13 UTC 95508a075181397ae1040e75116a42af89dc0155
1 file changed +7 -13
t/t1301-shared-repo.sh
+7 -13
@@ -12,12 +12,11 @@ setfacl -k . 2>/dev/null
12
13 # User must have read permissions to the repo -> failure on --shared=0400
14 test_expect_success 'shared = 0400 (faulty permission u-w)' '
15 + test_when_finished "rm -rf sub" &&
16 mkdir sub && (
16 - cd sub && git init --shared=0400
17 + cd sub &&
18 + test_must_fail git init --shared=0400
19 )
18 - ret="$?"
19 - rm -rf sub
20 - test $ret != "0"
20 '
21
22 modebits () {
@@ -33,7 +32,7 @@ do
32 git init --shared=1 &&
33 test 1 = "$(git config core.sharedrepository)"
34 ) &&
36 - actual=$(ls -l sub/.git/HEAD)
35 + actual=$(ls -l sub/.git/HEAD) &&
36 case "$actual" in
37 -rw-rw-r--*)
38 : happy
@@ -90,10 +89,8 @@ do
89 rm -f .git/info/refs &&
90 git update-server-info &&
91 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 +
94 '
95
96 umask 077 &&
@@ -102,10 +99,7 @@ do
99 rm -f .git/info/refs &&
100 git update-server-info &&
101 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"
103
104 '
105