diff --git a/bin/git-pull-and-if-origin-changed-run-tests b/bin/git-pull-and-if-origin-changed-run-tests index 5f29db56..ae5d7fd1 100755 --- a/bin/git-pull-and-if-origin-changed-run-tests +++ b/bin/git-pull-and-if-origin-changed-run-tests @@ -6,7 +6,7 @@ while true; do echo "Checking for new commits on any branch ..." git fetch origin - branch_with_new_commits=`git fetch origin >/dev/null; git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[behind' | cut -d'[' -f1 | head -n1` + branch_with_new_commits=`git fetch origin >/dev/null; git for-each-ref --format='%(refname:short) %(upstream:track)' refs/heads | grep '\[behind' | cut -d' ' -f1 | head -n1` if [ -n "$branch_with_new_commits" ]; then echo "checking out branch: $branch_with_new_commits"