From 067591836283d1366f1f785cebd794ecf7f587e2 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Thu, 26 Sep 2024 14:17:41 +0200 Subject: [PATCH] fix branch recognition --- bin/git-pull-and-if-origin-changed-run-tests | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"