summary refs log tree commit diff
path: root/Completion/Unix
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2016-07-29 17:00:07 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2016-08-01 08:01:26 +0000
commitb056d8c909a4cf57c45bf9cb9767c90b23369070 (patch)
treef5c6c62f4a8f201c9b27b1b3de513de8a1472fdc /Completion/Unix
parent0782e0a0a60ade8ba7c2e7b99d488fcd75663e2c (diff)
downloadzsh-b056d8c909a4cf57c45bf9cb9767c90b23369070.tar.gz
zsh-b056d8c909a4cf57c45bf9cb9767c90b23369070.tar.xz
zsh-b056d8c909a4cf57c45bf9cb9767c90b23369070.zip
38963: _git-config: Run gettable-options earlier and in all codepaths.
No change to completions; this is preparation for the next commit.
Diffstat (limited to 'Completion/Unix')
-rw-r--r--Completion/Unix/Command/_git8
1 files changed, 6 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index b23076a1a..30af6bc07 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -2454,6 +2454,11 @@ _git-config () {
     user.signingkey:'default GPG key to use when creating signed tags::__git_gpg_secret_keys'
     web.browser:'web browser to use::__git_browsers')
 
+  declare -a git_present_options # 'present' is an adjective
+  git_present_options=(
+    ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:}
+  )
+
   case $state in
     (section)
       __git_config_sections -b '(|)' '^' section-names 'section name' $* && ret=0
@@ -2663,8 +2668,7 @@ _git-config () {
         options -M 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' && ret=0
       ;;
     (gettable-option)
-      _wanted git-options expl option compadd -M 'r:|.=* r:|=*' - \
-        ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:} && ret=0
+      _wanted git-options expl option compadd -M 'r:|.=* r:|=*' -a - git_present_options && ret=0
       ;;
     (gettable-colorbool-option)
       __git_config_sections -b '(|)' -a '(|)' '^color\.[^.]+$' gettable-colorbool-options option && ret=0