]> git.ipfire.org Git - thirdparty/git.git/commit - contrib/completion/git-completion.bash
completion: fill COMPREPLY directly when completing fetch refspecs
authorSZEDER Gábor <szeder.dev@gmail.com>
Thu, 23 Mar 2017 15:29:23 +0000 (16:29 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 23 Mar 2017 18:18:22 +0000 (11:18 -0700)
commit745d655dc9fd2a9a02497240b4e254059f9d54f1
treead6f8ffd2600457be16c66bd34411fac0455cdf9
parentfef56eb0063dcf61796bf812ba980c99ce85f6b0
completion: fill COMPREPLY directly when completing fetch refspecs

The __git_complete_fetch_refspecs() has to iterate over __git_refs()'s
output anyway to turn the listed matching refs into refspecs, and it
knows about the prefix and suffix that has to be added to each
refspec.

Modify this function to add the prefix and suffix to each refspec
while iterating and feed the result, since it doesn't need further
processing, to the new __gitcomp_direct() helper added in the previous
commit, because it should be faster when there are a lot of refspecs
to list.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash