Merge branch 'bc/git-p4-for-python-2.4'
[gitweb.git] / contrib / completion / git-completion.bash
index 8c49ce25443c531fb11243d8faf19010a209e970..5770b6f2d01c6d08c337a2901bba276f3d99f2d0 100644 (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;;