summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-01-15 23:20:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-15 23:20:30 (GMT)
commitf9fb9063fd792e3f50ae2cd0847c88d2df287068 (patch)
tree30890fbcdb81542309e29383230e223dd42c249d /t
parent62fb47a4d3a93d97f4ed82323425135ecd3b84f5 (diff)
parent5a067ba9d04eebc92ad77f101b785219238f4f1e (diff)
downloadgit-f9fb9063fd792e3f50ae2cd0847c88d2df287068.zip
git-f9fb9063fd792e3f50ae2cd0847c88d2df287068.tar.gz
git-f9fb9063fd792e3f50ae2cd0847c88d2df287068.tar.bz2
Merge branch 'fc/completion-aliases-support'
Bash completion (in contrib/) update to make it easier for end-users to add completion for their custom "git" subcommands. * fc/completion-aliases-support: completion: add proper public __git_complete test: completion: add tests for __git_complete completion: bash: improve function detection completion: bash: add __git_have_func helper
Diffstat (limited to 't')
-rwxr-xr-xt/t9902-completion.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh
index a1c4f1f..c4a7758 100755
--- a/t/t9902-completion.sh
+++ b/t/t9902-completion.sh
@@ -2380,4 +2380,24 @@ test_expect_success 'sourcing the completion script clears cached --options' '
verbose test -z "$__gitcomp_builtin_notes_edit"
'
+test_expect_success '__git_complete' '
+ unset -f __git_wrap__git_main &&
+
+ __git_complete foo __git_main &&
+ __git_have_func __git_wrap__git_main &&
+ unset -f __git_wrap__git_main &&
+
+ __git_complete gf _git_fetch &&
+ __git_have_func __git_wrap_git_fetch &&
+
+ __git_complete foo git &&
+ __git_have_func __git_wrap__git_main &&
+ unset -f __git_wrap__git_main &&
+
+ __git_complete gd git_diff &&
+ __git_have_func __git_wrap_git_diff &&
+
+ test_must_fail __git_complete ga missing
+'
+
test_done