Unverified Commit 7ee1e16c authored by teor's avatar teor
Browse files

scripts/git: Stop failing when upstream branches don't exist

If you add a custom remote, or a new branch, and don't fetch first,
then the script would fail when checking for unchanged branches.

Instead, skip the check: a new branch is definitely a change.
parent 3864536b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -251,7 +251,8 @@ if [ "$PUSH_SAME" -eq 0 ]; then
    PUSH_COMMIT=$(git rev-parse "$b")
    SKIP_UPSTREAM=
    for u in $UPSTREAM_SKIP_SAME_AS; do
      UPSTREAM_COMMIT=$(git rev-parse "$u")
      # Skip the branch check on error
      UPSTREAM_COMMIT=$(git rev-parse "$u" 2>/dev/null) || continue
      if [ "$PUSH_COMMIT" = "$UPSTREAM_COMMIT" ]; then
        SKIP_UPSTREAM="$u"
      fi