@@ -226,6 +226,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
@@ -239,6 +240,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
@@ -1090,7 +1090,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
@@ -1105,7 +1105,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-completion-zsh.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-)