aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorBritton Leo Kerin <britton.kerin@gmail.com>2024-02-06 12:50:44 -0900
committerJunio C Hamano <gitster@pobox.com>2024-02-06 15:11:46 -0800
commitaf8910a2d4cdc3452c4b48e073e18fc10ff76723 (patch)
tree15a00fe83f5e40e6fc50ebfc4463d3a84cdde2c7 /t
parente1f74dd58b77fe9bc5ed196221642395cf8951d0 (diff)
downloadgit-af8910a2d4cdc3452c4b48e073e18fc10ff76723.tar.xz
completion: bisect: complete custom terms and related options
git bisect supports the use of custom terms via the --term-(new|bad) and --term-(old|good) options, but the completion code doesn't know about these options or the new subcommands they define. Add support for these options and the custom subcommands by checking for BISECT_TERMS and adding them to the list of subcommands. Add tests. Signed-off-by: Britton Leo Kerin <britton.kerin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index 7388c892cf..304903b1a7 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -1321,9 +1321,12 @@ test_expect_success 'git-bisect - when bisecting all subcommands are candidates'
test_completion "git bisect " <<-\EOF
start Z
bad Z
+ custom_new Z
+ custom_old Z
new Z
good Z
old Z
+ terms Z
skip Z
reset Z
visualize Z
@@ -1335,6 +1338,18 @@ test_expect_success 'git-bisect - when bisecting all subcommands are candidates'
)
'
+test_expect_success 'git-bisect - options to terms subcommand are candidates' '
+ (
+ cd git-bisect &&
+ test_completion "git bisect terms --" <<-\EOF
+ --term-bad Z
+ --term-good Z
+ --term-new Z
+ --term-old Z
+ EOF
+ )
+'
+
test_expect_success 'git checkout - completes refs and unique remote branches for DWIM' '
test_completion "git checkout " <<-\EOF
HEAD Z