summaryrefslogtreecommitdiff
path: root/scripts/git
diff options
context:
space:
mode:
authorteor <teor@torproject.org>2019-11-07 12:04:51 +1000
committerteor <teor@torproject.org>2019-11-07 12:04:51 +1000
commit7ee1e16c6f9d5ddc9ceae6aac7a25291e1336426 (patch)
tree8b794a2104d45eb4b0034b210c2e81c503dd4808 /scripts/git
parent3864536b7c19ad628df4b2f4d492ef4adc0f536c (diff)
downloadtor-7ee1e16c6f9d5ddc9ceae6aac7a25291e1336426.tar.gz
tor-7ee1e16c6f9d5ddc9ceae6aac7a25291e1336426.zip
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.
Diffstat (limited to 'scripts/git')
-rwxr-xr-xscripts/git/git-push-all.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/git/git-push-all.sh b/scripts/git/git-push-all.sh
index 4738658f1d..293df03423 100755
--- a/scripts/git/git-push-all.sh
+++ b/scripts/git/git-push-all.sh
@@ -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