summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/completion/git-completion.bash10
-rwxr-xr-xt/t9902-completion.sh2
2 files changed, 10 insertions, 2 deletions
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