mod to check if remote branch exists
[feisty_meow.git] / scripts / rev_control / version_control.sh
index 1224480f3823fe27a3ec7c6a8e79ebbc689b707b..7145416f66f9450ab0ad5223a9eee20ae7cfcae5 100644 (file)
@@ -283,9 +283,6 @@ function do_careful_git_update()
 {
   local this_branch="$(my_branch_name)"
 
-#proposition: this step didn't help before, and it seems redundant now.
-#...
-#hmmm, maybe it is needed.  and people did seem to want it first, so trying that.
   # first update all our remote branches to their current state from the repos.
   git remote update
   test_or_die "git remote update"
@@ -302,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
+    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.