completion: use 'sort -u' to deduplicate config variable names

The completion script runs the classic '| sort | uniq' pipeline to
deduplicate the output of 'git help --config-for-completion'.  'sort
-u' does the same, but uses one less external process and pipeline
stage.  Not a bit win, as it's only run once as the list of supported
configuration variables is initialized, but at least it sets a better
example for others to follow.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
SZEDER Gábor 2019-08-13 14:26:46 +02:00 committed by Junio C Hamano
parent d9438873c4
commit 2675ea1cc0

View file

@ -2225,7 +2225,7 @@ __git_config_vars=
__git_compute_config_vars ()
{
test -n "$__git_config_vars" ||
__git_config_vars="$(git help --config-for-completion | sort | uniq)"
__git_config_vars="$(git help --config-for-completion | sort -u)"
}
_git_config ()