summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorStephan Beyer <s-beyer@gmx.net>2017-11-12 21:55:33 +0100
committerJunio C Hamano <gitster@pobox.com>2017-11-13 12:59:17 +0900
commitfecd2dd36e6210c0211c812f1be2a07c71c6dcdc (patch)
tree510d8c42e4fe23d5888800b5f4e5bc54c7212ec6 /git-bisect.sh
parent4123bcaed0897cad152c052a5fa4e499e4dafcf4 (diff)
downloadgit-fecd2dd36e6210c0211c812f1be2a07c71c6dcdc.tar.gz
bisect run: die if no command is givensb/bisect-run-empty
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>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 0138a8860e..a69e436563 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -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="$@"