Re: [PATCH 1/7] Use 'printf %s $x' notation in t5401

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

 



"Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes:

> We only care about getting what should be an empty string and
> sending it to a file, without a trailing LF, so the empty string
> translates into a 0 byte file.  Earlier when I originally wrote
> these lines Mac OS X allowed the format string of printf to be
> the empty string, but more recent versions appear to have been
> 'improved' with error messages if the format is not given.

That sounds like a bug to me.

> diff --git a/t/t5401-update-hooks.sh b/t/t5401-update-hooks.sh
> index 3eea306..9734fc5 100755
> --- a/t/t5401-update-hooks.sh
> +++ b/t/t5401-update-hooks.sh
> @@ -25,7 +25,7 @@ test_expect_success setup '
>  
>  cat >victim/.git/hooks/pre-receive <<'EOF'
>  #!/bin/sh
> -printf "$@" >>$GIT_DIR/pre-receive.args
> +printf %s "$@" >>$GIT_DIR/pre-receive.args

Do you really mean this? "printf %s 1 2 3" writes "123" without
terminating LF.  You seem to check only for size but to be
reusable you might want to use something like:

	printf '%s\n' "$@"

Likewise for post-receive.args.
-
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]

  Powered by Linux