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.

backport: Give a sensible error when trying to backport an unmerged PR.

Mateusz Mandera8b189cdf30d7
diff --git a/tools/backport-pull-request b/tools/backport-pull-request
index ad28389ddb1..462627b3fdc 100755
--- a/tools/backport-pull-request
+++ b/tools/backport-pull-request
@@ -60,6 +60,8 @@ query($pr_id:Int!) {
'
)"
+[ -n "$merge_commit" ] || fail "PR #$pr_id is not merged into 'main'. Merge it first before backporting."
+
# We cannot trust the "commits" count on the PR, since only part of it
# may get merged, or it may have commits squashed during the merge.
# Walk backwards on `main` from the merge commit we found, checking