fix branch recognition

This commit is contained in:
Michael Hoennig 2024-09-26 14:17:41 +02:00
parent e8c4946111
commit 0675918362

View File

@ -6,7 +6,7 @@
while true; do while true; do
echo "Checking for new commits on any branch ..." echo "Checking for new commits on any branch ..."
git fetch origin 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 if [ -n "$branch_with_new_commits" ]; then
echo "checking out branch: $branch_with_new_commits" echo "checking out branch: $branch_with_new_commits"