diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index c59347daee..f89324d84f 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -2398,7 +2398,15 @@ _git_config () ;; *) __git_compute_config_vars - __gitcomp "$(echo "$__git_config_vars" | sed 's/\.[^ ]*/./g')" + __gitcomp "$(echo "$__git_config_vars" | + awk -F . '{ + sections[$1] = 1 + } + END { + for (s in sections) + print s "." + } + ')" esac } diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index e15be1164d..008fba7c89 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -1698,7 +1698,7 @@ do ' done -test_expect_failure 'git config - section' ' +test_expect_success 'git config - section' ' test_completion "git config br" <<-\EOF branch.Z browser.Z