@@ -231,6 +231,7 @@ __git_zsh_main ()
'--no-replace-objects[do not use replacement refs to replace git objects]' \
'(- :)--help[prints the synopsis and a list of the most commonly used commands]: :->arg' \
'*-C[run as if git was started in the given path]: :_directories' \
+ '*-c[pass a configuration parameter to the command]: :->config' \
'(-): :->command' \
'(-)*:: :->arg' && return
@@ -244,6 +245,10 @@ __git_zsh_main ()
let _ret || break
done
;;
+ (config)
+ compset -P '*[=:]'
+ emulate ksh -c __git_complete_config_variable_name_and_value
+ ;;
(arg)
local command="${words[1]}" __git_dir __git_cmd_idx=1
@@ -1071,7 +1071,7 @@ test_expect_success 'git config - value' '
EOF
'
-test_expect_failure 'git -c - section' '
+test_expect_success 'git -c - section' '
test_completion "git -c br" <<-\EOF
branch.Z
browser.Z
@@ -1086,7 +1086,7 @@ test_expect_failure 'git -c - variable name' '
EOF
'
-test_expect_failure 'git -c - value' '
+test_expect_success 'git -c - value' '
test_completion "git -c color.pager=" <<-\EOF
false Z
true Z
So we can specify configurations. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- contrib/completion/git-completion.zsh | 5 +++++ t/t9904-zsh-completion.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)