OSDN Git Service

bisect run: die if no command is given
authorStephan Beyer <s-beyer@gmx.net>
Sun, 12 Nov 2017 20:55:33 +0000 (21:55 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Nov 2017 03:59:17 +0000 (12:59 +0900)
It was possible to invoke "git bisect run" without any command.
This considers all commits as good commits since "$@"'s return
value for empty $@ is 0.

This is most probably not what a user wants (otherwise she would
invoke "git bisect run true"), so not providing a command now
results in an error.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-bisect.sh

index 0138a88..a69e436 100755 (executable)
@@ -450,6 +450,8 @@ bisect_replay () {
 bisect_run () {
        bisect_next_check fail
 
+       test -n "$*" || die "$(gettext "bisect run failed: no command provided.")"
+
        while true
        do
                command="$@"