aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-02-07 15:15:23 -0800
committerJunio C Hamano <gitster@pobox.com>2013-02-07 15:15:23 -0800
commit696c35972fdb0b80e68e61fba4055f29777ca3a9 (patch)
treea794843e78da68e878f03f6749b64a2865066bd9 /contrib
parent772847341bc6ea73c57f350ae25688eae95c5c23 (diff)
parent5047822347f8d7ad453ad0ea5cbff542569fb7a6 (diff)
downloadgit-696c35972fdb0b80e68e61fba4055f29777ca3a9.tar.gz
git-696c35972fdb0b80e68e61fba4055f29777ca3a9.tar.xz
Merge branch 'jc/do-not-let-random-file-interfere-with-completion-tests' into maint
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')
-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 468c96c4a..2186b4b77 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;;