summaryrefslogtreecommitdiff
path: root/git-bisect.sh
diff options
context:
space:
mode:
authorĐoàn Trần Công Danh <congdanhqx@gmail.com>2022-11-10 16:36:22 (GMT)
committerTaylor Blau <me@ttaylorr.com>2022-11-11 22:04:57 (GMT)
commite9011b6092411ca802907a1236d3137bf09081b6 (patch)
treed316da1a54fa5b41bd64d32b093e8ad8124040c8 /git-bisect.sh
parent464ce0aba8526a287c13f96f8d774d7374b647b3 (diff)
downloadgit-e9011b6092411ca802907a1236d3137bf09081b6.zip
git-e9011b6092411ca802907a1236d3137bf09081b6.tar.gz
git-e9011b6092411ca802907a1236d3137bf09081b6.tar.bz2
bisect--helper: parse subcommand with OPT_SUBCOMMAND
As of it is, we're parsing subcommand with OPT_CMDMODE, which will continue to parse more options even if the command has been found. When we're running "git bisect run" with a command that expecting a "--log" or "--no-log" arguments, or one of those "--bisect-..." arguments, bisect--helper may mistakenly think those options are bisect--helper's option. We may fix those problems by passing "--" when calling from git-bisect.sh, and skip that "--" in bisect--helper. However, it may interfere with user's "--". Let's parse subcommand with OPT_SUBCOMMAND since that API was born for this specific use-case. Reported-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'git-bisect.sh')
-rwxr-xr-xgit-bisect.sh23
1 files changed, 3 insertions, 20 deletions
diff --git a/git-bisect.sh b/git-bisect.sh
index 405cf76..dfce4b4 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -57,28 +57,11 @@ case "$#" in
case "$cmd" in
help)
git bisect -h ;;
- start)
- git bisect--helper --bisect-start "$@" ;;
bad|good|new|old|"$TERM_BAD"|"$TERM_GOOD")
- git bisect--helper --bisect-state "$cmd" "$@" ;;
- skip)
- git bisect--helper --bisect-skip "$@" || exit;;
- next)
- # Not sure we want "next" at the UI level anymore.
- git bisect--helper --bisect-next "$@" || exit ;;
- visualize|view)
- git bisect--helper --bisect-visualize "$@" || exit;;
- reset)
- git bisect--helper --bisect-reset "$@" ;;
- replay)
- git bisect--helper --bisect-replay "$@" || exit;;
+ git bisect--helper state "$cmd" "$@" ;;
log)
- git bisect--helper --bisect-log || exit ;;
- run)
- git bisect--helper --bisect-run "$@" || exit;;
- terms)
- git bisect--helper --bisect-terms "$@" || exit;;
+ git bisect--helper log || exit ;;
*)
- usage ;;
+ git bisect--helper "$cmd" "$@" ;;
esac
esac