completion: use __gitcompadd for __gitcomp_file
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 27 Apr 2013 20:10:02 +0000 (15:10 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 27 Apr 2013 21:32:28 +0000 (14:32 -0700)
Like the rest of the script does; let's not access COMPREPLY directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
index f7b0f3c8f0214fc9a15c570cb272d8516c9ea804..7f1ebe4895d42e62b889d17e93d941f52b23ec24 100644 (file)
@@ -252,7 +252,7 @@ __gitcomp_file ()
        # since tilde expansion is not applied.
        # This means that COMPREPLY will be empty and Bash default
        # completion will be used.
-       COMPREPLY=($(compgen -P "${2-}" -W "$1" -- "${3-$cur}"))
+       __gitcompadd "$1" "${2-}" "${3-$cur}" ""
 
        # Tell Bash that compspec generates filenames.
        compopt -o filenames 2>/dev/null