From: Felipe Contreras Date: Tue, 30 Aug 2022 09:31:03 GMT Subject: [PATCH 16/51] completion: bash: remove non-append functionality Message-ID: <20220830093138.1581538-17-felipe.contreras@gmail.com> In-Reply-To: <20220830093138.1581538-1-felipe.contreras@gmail.com> There's no point in setting COMPREPLY only to override it later, and in fact... we don't do that. Therefore there's no functional difference between __gitcomp_direct() and __gitcomp_direct_append(), since __gitcomp_direct() *always* operates on empty COMPREPLY. The same goes for __gitcomp_nl(). This patch makes the functionality of append and non-append functions the same. No functional changes. Signed-off-by: Felipe Contreras --- contrib/completion/git-completion.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index ef0b7aa192..6571dc1b2d 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -312,7 +312,7 @@ __gitcomp_direct () { local IFS=$'\n' - COMPREPLY=($1) + COMPREPLY+=($1) } # Similar to __gitcomp_direct, but appends to COMPREPLY instead. @@ -464,7 +464,6 @@ __gitcomp_nl_append () # appended. __gitcomp_nl () { - COMPREPLY=() __gitcomp_nl_append "$@" } -- 2.37.2.351.g9bf691b78c.dirty