Re: [PATCH v2 02/22] test-lib-functions: document and test test_commit --no-tag

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> @@ -242,7 +245,10 @@ test_commit () {
>  	git ${indir:+ -C "$indir"} commit \
>  	    ${author:+ --author "$author"} \
>  	    $signoff -m "$1" &&
> -	if test -z "$no_tag"
> +	if test -n "$no_tag" -a $# -eq 4

Let's spell it

	test -n "$no_tag" && test $# = 4

to avoid clueless newbie from cargo-culting the use of '-o' and '-a'
with test in an unsafe context, even though the way you used it here
is perfectly safe.

> +	then
> +		BUG "expect no <tag> parameter with --no-tag"
> +	elif test -z "$no_tag"
>  	then
>  		git ${indir:+ -C "$indir"} tag "${4:-$1}"
>  	fi




[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