author | SZEDER Gábor <szeder@ira.uka.de> | |
Sat, 8 Oct 2011 14:54:38 +0000 (16:54 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 21 Oct 2011 21:38:23 +0000 (14:38 -0700) | ||
commit | d8c0453e1a81db03880a9f237675d82cdc290d2c | |
tree | 943c6e8d28949bf94ad881ffabffb250523b4621 | tree | snapshot |
parent | abf05987de7b61972e85392ca2f1a4fc25046e57 | commit | diff |
completion: improve ls-remote output filtering in __git_refs()
The remote-handling part of __git_refs() has a nice for loop and state
machine case statement to iterate over all words from the output of
'git ls-remote' to identify object names and ref names. Since each
line in the output of 'git ls-remote' consists of an object name and a
ref name, we can do more effective filtering by using a while-read
loop and letting bash's word splitting take care of object names.
This way the code is easier to understand and the loop will need only
half the number of iterations than before.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The remote-handling part of __git_refs() has a nice for loop and state
machine case statement to iterate over all words from the output of
'git ls-remote' to identify object names and ref names. Since each
line in the output of 'git ls-remote' consists of an object name and a
ref name, we can do more effective filtering by using a while-read
loop and letting bash's word splitting take care of object names.
This way the code is easier to understand and the loop will need only
half the number of iterations than before.
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | diff | blob | history |