From f95e9a854496fe8ebc88004ea38f1b0820e7a4e5 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Fri, 3 Feb 2012 17:51:40 +0800 Subject: [PATCH] Updating build statuses for all branches only periodically is still too slow. Now it only updates statuses for branches from remotes/origin that also have a local copy --- lib/git/tools.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/git/tools.sh b/lib/git/tools.sh index a110ad0..7bf7d16 100644 --- a/lib/git/tools.sh +++ b/lib/git/tools.sh @@ -133,8 +133,12 @@ update_travis_ci_status() { # Either update all branches, or only current branch if [ "$UPDATE_ALL_BRANCHES" = "true" ]; then - # All branches on origin remotes - local branches="$(\git branch -a | sed "s/ *remotes\/origin\///;tm;d;:m;/^HEAD/d;")" + local all_branches=$(\git branch -a) + # All branches on origin remote that have local copies + local branches=$(comm -12 <(echo "$all_branches" | \ + sed "s/ *remotes\/origin\///;tm;d;:m;/^HEAD/d;" | sort) \ + <(echo "$all_branches" | \ + sed "/ *remotes\//d;s/^[\* ]*//" | sort)) # Create a new, blank temp file echo -n > "$tmp_stat_file" else