summaryrefslogtreecommitdiff
path: root/contrib/completion/git-completion.bash
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-02-01 12:39:46 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-01 12:39:46 -0800
commit51a1d232a7c1bc6bbdb4ac47ab2e91ad3873b25b (patch)
tree2c9af1469a1c774dbf788723d4e70c886833397a /contrib/completion/git-completion.bash
parentMerge branch 'as/test-cleanup' (diff)
parentt9902: protect test from stray build artifacts (diff)
downloadtgif-51a1d232a7c1bc6bbdb4ac47ab2e91ad3873b25b.tar.xz
Merge branch 'jc/do-not-let-random-file-interfere-with-completion-tests'
Scripts to test bash completion was inherently flaky as it was affected by whatever random things the user may have on $PATH. * jc/do-not-let-random-file-interfere-with-completion-tests: t9902: protect test from stray build artifacts
Diffstat (limited to 'contrib/completion/git-completion.bash')
-rw-r--r--contrib/completion/git-completion.bash11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 8c49ce2544..5770b6f2d0 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -531,10 +531,19 @@ __git_complete_strategy ()
return 1
}
+__git_commands () {
+ if test -n "${GIT_TESTING_COMMAND_COMPLETION:-}"
+ then
+ printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
+ else
+ git help -a|egrep '^ [a-zA-Z0-9]'
+ fi
+}
+
__git_list_all_commands ()
{
local i IFS=" "$'\n'
- for i in $(git help -a|egrep '^ [a-zA-Z0-9]')
+ for i in $(__git_commands)
do
case $i in
*--*) : helper pattern;;