summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2019-03-20 18:03:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-21 02:55:34 (GMT)
commit2eb6f09f7d9c02266f7e6ac8b1591abc8b10278d (patch)
treea1f434b215dfc5ed31855349660d84b7855fb4cc /contrib/completion
parent057ab54b6646fbdabc8c953299f218081ff67456 (diff)
downloadgit-2eb6f09f7d9c02266f7e6ac8b1591abc8b10278d.zip
git-2eb6f09f7d9c02266f7e6ac8b1591abc8b10278d.tar.gz
git-2eb6f09f7d9c02266f7e6ac8b1591abc8b10278d.tar.bz2
completion: use __git when calling --list-cmds
As we made --list-cmds read the local configuration file in an earlier step, the completion.commands variable respects repo-level configuration. Use __git which ensures that the proper repo config is consulted if the command line contains 'git -C /some/other/repo'. Suggested-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Todd Zullinger <tmz@pobox.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 976e4a6..93b5e97 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1024,7 +1024,7 @@ __git_all_commands=
__git_compute_all_commands ()
{
test -n "$__git_all_commands" ||
- __git_all_commands=$(git --list-cmds=main,others,alias,nohelpers)
+ __git_all_commands=$(__git --list-cmds=main,others,alias,nohelpers)
}
# Lists all set config variables starting with the given section prefix,
@@ -1652,9 +1652,9 @@ _git_help ()
esac
if test -n "$GIT_TESTING_ALL_COMMAND_LIST"
then
- __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(git --list-cmds=alias,list-guide) gitk"
+ __gitcomp "$GIT_TESTING_ALL_COMMAND_LIST $(__git --list-cmds=alias,list-guide) gitk"
else
- __gitcomp "$(git --list-cmds=main,nohelpers,alias,list-guide) gitk"
+ __gitcomp "$(__git --list-cmds=main,nohelpers,alias,list-guide) gitk"
fi
}
@@ -2925,7 +2925,7 @@ __git_main ()
then
__gitcomp "$GIT_TESTING_PORCELAIN_COMMAND_LIST"
else
- __gitcomp "$(git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
+ __gitcomp "$(__git --list-cmds=list-mainporcelain,others,nohelpers,alias,list-complete,config)"
fi
;;
esac