From aaf7a6bda56c046f10016ab8324012e10bdd3385 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 12 Sep 2014 08:52:27 -0400 Subject: mildly simplify ref-fetching with git-for-each-ref --- remote.inc.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/remote.inc.sh b/remote.inc.sh index ba72565..61204bf 100644 --- a/remote.inc.sh +++ b/remote.inc.sh @@ -46,9 +46,8 @@ remote_is_tracking() { remote_get_tracked_refs() { local remote=$1 - mapfile -t "$2" < <(git branch --remote 2>/dev/null | - awk -F'( +|/)' -v "remote=$1" \ - '$2 == remote && $3 == "packages" { print "packages/" $4 }') + mapfile -t "$2" < <(git for-each-ref --format='%(refname)' "refs/remotes/$1" | + awk -F'/' -v "remote=$1" '{ print "packages/" $NF }') } remote_update_refs() { -- cgit v1.2.3-70-g09d2