From 8312dbd6829564ff2136b356966a66e60387e8cd Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 10 Nov 2017 16:08:52 -0500 Subject: [PATCH] mod to check if remote branch exists --- scripts/rev_control/version_control.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index 84607308..7145416f 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -299,8 +299,12 @@ function do_careful_git_update() for bran in $branch_list; do # echo "synchronizing remote branch: $bran" git checkout "$bran" - test_or_die "git checking out remote branch: $bran" - git pull --no-ff origin "$bran" + test_or_die "git switching checkout to remote branch: $bran" + remote_branch_info=$(git ls-remote --heads origin $bran 2>/dev/null) + if [ ! -z "$remote_branch_info" ]; then + # we are pretty sure the remote branch does exist. + git pull --no-ff origin "$bran" + fi test_or_die "git pull of remote branch: $bran" done # now switch back to our branch. -- 2.34.1