Re: [PATCH v2 02/22] test-lib-functions: document and test test_commit --no-tag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 30, 2021, 23:14 UTC
- Message-ID
- <xmqqa6qkb5fi.fsf@gitster.g>
- In-Reply-To
- <20210216115801.4773-3-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 6 quoted lines
> @@ -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 4Let'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.
Show 6 quoted lines
> + then
> + BUG "expect no <tag> parameter with --no-tag"
> + elif test -z "$no_tag"
> then
> git ${indir:+ -C "$indir"} tag "${4:-$1}"
> fi