summaryrefslogtreecommitdiff
path: root/t/t1301-shared-repo.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-03-20 10:13:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-20 18:35:56 (GMT)
commit95508a075181397ae1040e75116a42af89dc0155 (patch)
treecc58b6349bd711b4daf36ba4e9343c77b5eeda2a /t/t1301-shared-repo.sh
parent9157c5cb0968f1d97bf4a79b8622a9601387a368 (diff)
downloadgit-95508a075181397ae1040e75116a42af89dc0155.zip
git-95508a075181397ae1040e75116a42af89dc0155.tar.gz
git-95508a075181397ae1040e75116a42af89dc0155.tar.bz2
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>
Diffstat (limited to 't/t1301-shared-repo.sh')
-rwxr-xr-xt/t1301-shared-repo.sh20
1 files changed, 7 insertions, 13 deletions
diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index 7eecfb8..ac10875 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -12,12 +12,11 @@ setfacl -k . 2>/dev/null
# User must have read permissions to the repo -> failure on --shared=0400
test_expect_success 'shared = 0400 (faulty permission u-w)' '
+ test_when_finished "rm -rf sub" &&
mkdir sub && (
- cd sub && git init --shared=0400
+ cd sub &&
+ test_must_fail git init --shared=0400
)
- ret="$?"
- rm -rf sub
- test $ret != "0"
'
modebits () {
@@ -33,7 +32,7 @@ do
git init --shared=1 &&
test 1 = "$(git config core.sharedrepository)"
) &&
- actual=$(ls -l sub/.git/HEAD)
+ actual=$(ls -l sub/.git/HEAD) &&
case "$actual" in
-rw-rw-r--*)
: happy
@@ -90,10 +89,8 @@ do
rm -f .git/info/refs &&
git update-server-info &&
actual="$(modebits .git/info/refs)" &&
- test "x$actual" = "x-$y" || {
- ls -lt .git/info
- false
- }
+ verbose test "x$actual" = "x-$y"
+
'
umask 077 &&
@@ -102,10 +99,7 @@ do
rm -f .git/info/refs &&
git update-server-info &&
actual="$(modebits .git/info/refs)" &&
- test "x$actual" = "x-$x" || {
- ls -lt .git/info
- false
- }
+ verbose test "x$actual" = "x-$x"
'