Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

push-to-pull-request: Wait for GitHub background update before merge.

Anders Kaseorg4bcf7131c149
diff --git a/tools/push-to-pull-request b/tools/push-to-pull-request
index 27d13cb5cce..8fabc819af4 100755
--- a/tools/push-to-pull-request
+++ b/tools/push-to-pull-request
@@ -142,5 +142,17 @@ if [ -n "$tracking_ref" ]; then
fi
if [ "$merge" ]; then
+ tries=10
+ sha="$(git rev-parse @)"
+ while
+ out=$(git ls-remote -- "$remote" "refs/pull/$pr_id/head")
+ [ "$out" != "$sha refs/pull/$pr_id/head" ]
+ do
+ if ! ((--tries)); then
+ echo 'error: Push was not observed in PR' >&2
+ exit 1
+ fi
+ sleep 1
+ done
git push -- "$remote" "@:$pr_base_ref"
fi