contrib/subtree: stop using `-o` to test for number of args
commit88983946fa00ebea8b346acab46e19bceeed427d
authorPatrick Steinhardt <ps@pks.im>
Fri, 10 Nov 2023 10:01:19 +0000 (10 11:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 11 Nov 2023 00:21:00 +0000 (11 09:21 +0900)
tree1587e3d1de006c01609c5e65c517d8af1138d5d2
parent13420028e5b119d27277d521f4d267212c5ca21c
contrib/subtree: stop using `-o` to test for number of args

Functions in git-subtree.sh all assert that they are being passed the
correct number of arguments. In cases where we accept a variable number
of arguments we assert this via a single call to `test` with `-o`, which
is discouraged by our coding guidelines.

Convert these cases to stop doing so. This requires us to decompose
assertions of the style `assert test $# = 2 -o $# = 3` into two calls
because we have no easy way to logically chain statements passed to the
assert function.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/git-subtree.sh