Re: [PATCH 18/25] t1301: use modern test_* helpers
- From
SZEDER Gábor <szeder@ira.uka.de>
- Date
- Mar 24, 2015, 23:51 UTC
- Message-ID
- <20150325005120.Horde.ClYI1WJflnvTzVgcL6i8Sg8@webmail.informatik.kit.edu>
- In-Reply-To
- <20150320101311.GR12543@peff.net>
Quoting Jeff King <peff@peff.net>:
Show 36 quoted lines
> This shortens the code and fixes some &&-chaining.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> t/t1301-shared-repo.sh | 20 +++++++-------------
> 1 file 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--*)
> : happyThis hunk could go into the "moderate &&-chain breakage" patch. Doesn't really matter, what matters most is that it's fixed, but I really liked your classification of missing &&s in the early patches.
Show 27 quoted lines
> @@ -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"
>
> '
>
> --
> 2.3.3.520.g3cfbb5d