completion: improve ls-remote output filtering in __git_refs_remotes()
This follows suit of a previous patch for __git_refs(): use a while-read loop and let bash's word splitting get rid of object names from 'git ls-remote's output. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
d79bcf2cf2
commit
48058f5df4
@ -651,15 +651,10 @@ __git_refs2 ()
|
|||||||
# __git_refs_remotes requires 1 argument (to pass to ls-remote)
|
# __git_refs_remotes requires 1 argument (to pass to ls-remote)
|
||||||
__git_refs_remotes ()
|
__git_refs_remotes ()
|
||||||
{
|
{
|
||||||
local i is_hash=y
|
local i hash
|
||||||
for i in $(git ls-remote "$1" 'refs/heads/*' 2>/dev/null); do
|
git ls-remote "$1" 'refs/heads/*' 2>/dev/null | \
|
||||||
case "$is_hash" in
|
while read hash i; do
|
||||||
n)
|
|
||||||
is_hash=y
|
|
||||||
echo "$i:refs/remotes/$1/${i#refs/heads/}"
|
echo "$i:refs/remotes/$1/${i#refs/heads/}"
|
||||||
;;
|
|
||||||
y) is_hash=n ;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user