Re: t4151 missing quotes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 9, 2016 at 2:56 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Something like this follows Documentation/SubmittingPatches [...]
>
> -- >8 --
> From: Armin Kunaschik <megabreit@xxxxxxxxxxxxxx>
> Subject: t4151: make sure argument to 'test -z' is given
>
> 88d50724 (am --skip: revert changes introduced by failed 3way merge,
> 2015-06-06), unlike all the other patches in the series, forgot to
> quote the output from "$(git ls-files -u)" when using it as the
> argument to "test -z", leading to a syntax error.

To make it clear that this was not a syntax error in the typical case,
it might make sense to say:

    ...potentially leading to a syntax error if some earlier tests failed.

> Note that $(git ls-files -u | wc -l) are deliberately left unquoted,
> as some implementations of "wc -l" includes extra blank characters
> in its output and cannot be compared as string, i.e. "test 0 = $(...)".

Aside from the above nit, this all looks good and (for what it's worth) is:

    Reviewed-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx>

> Signed-off-by:
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
>  t/t4151-am-abort.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh
> index 833e7b2..b878c21 100755
> --- a/t/t4151-am-abort.sh
> +++ b/t/t4151-am-abort.sh
> @@ -82,7 +82,7 @@ test_expect_success 'am -3 --abort removes otherfile-4' '
>         test 4 = "$(cat otherfile-4)" &&
>         git am --abort &&
>         test_cmp_rev initial HEAD &&
> -       test -z $(git ls-files -u) &&
> +       test -z "$(git ls-files -u)" &&
>         test_path_is_missing otherfile-4
>  '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]