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>
SZEDER Gábor committed
Aug 13, 2019 at 14:26 UTC
2675ea1cc0f5d542d9bde4e8a458ac726bf30f63
1 file changed
+1
-1
contrib/completion/git-completion.bash
+1
-1
@@ -2225,7 +2225,7 @@ __git_config_vars=
2225
__git_compute_config_vars ()
2226
{
2227
test -n "$__git_config_vars" ||
2228
- __git_config_vars="$(git help --config-for-completion | sort | uniq)"
2228
+ __git_config_vars="$(git help --config-for-completion | sort -u)"
2229
}
2230
2231
_git_config ()