]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
scripts/git: Avoid sleeping before the last push in git-push-all.sh
authorteor <teor@torproject.org>
Wed, 23 Oct 2019 03:28:37 +0000 (13:28 +1000)
committerteor <teor@torproject.org>
Wed, 23 Oct 2019 03:28:37 +0000 (13:28 +1000)
Change the loop order, so that we only sleep between pushes,
and avoid sleeping after all the pushes are done.

(In rare cases, there may still be an extra sleep.)

Part of 32216.

scripts/git/git-push-all.sh

index feb0c303125ad51792c2f7c0a541dc60c56014ed..ebfa576196451a3d5bbedb739818b70a92b64447 100755 (executable)
@@ -315,12 +315,15 @@ else
       printf "%s\n" "$RELEASE_BRANCHES"
     fi
   fi
-  $GIT_PUSH "$@" "$UPSTREAM_REMOTE" "$MASTER_BRANCH"
-  sleep "$PUSH_DELAY"
   # shellcheck disable=SC2086
-  for b in $MAINT_BRANCHES; do
+  for b in $MASTER_BRANCH $MAINT_BRANCHES; do
     $GIT_PUSH "$@" "$UPSTREAM_REMOTE" "$b"
-    sleep "$PUSH_DELAY"
+    # If we are pushing more than one branch, delay.
+    # In the unlikely scenario where we are pushing maint without master,
+    # or maint without release, there may be an extra delay
+    if [ "$MAINT_BRANCHES" ] || [ "$RELEASE_BRANCHES" ]; then
+      sleep "$PUSH_DELAY"
+    fi
   done
   if [ "$RELEASE_BRANCHES" ]; then
     # shellcheck disable=SC2086