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
This commit is contained in:
Junio C Hamano
2013-02-01 12:39:46 -08:00
2 changed files with 34 additions and 2 deletions

View File

@ -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;;