Fix git Command Completion Not Working After 2.18.0

- "git help -a|egrep '^ [a-zA-Z0-9]'" returns empty in "__git_commands" function
 - Used git --list-cmds introduced in git v2.18.0 as a fallback
pull/1297/head
Ahmad Salah 2018-12-30 19:46:42 +02:00
parent 3b47bc3684
commit 4cee5bd38a
1 changed files with 7 additions and 1 deletions

View File

@ -624,7 +624,13 @@ __git_commands () {
then then
printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}" printf "%s" "${GIT_TESTING_COMMAND_COMPLETION}"
else else
git help -a|egrep '^ [a-zA-Z0-9]' git_cmd_list=$(git help -a|egrep '^ [a-zA-Z0-9]')
if [ ! -z "$git_cmd_list" ]
then
"$git_cmd_list"
else
git --list-cmds=main,others,alias,nohelpers
fi
fi fi
} }