From f686d55fa016fcc69b6682c48a2a81efd1d4670d Mon Sep 17 00:00:00 2001 From: Greg Price Date: Fri, 1 Jun 2018 16:49:36 -0700 Subject: [PATCH] push-to-pull-request: Broaden one error message. I discovered this case just now while testing other changes. --- tools/push-to-pull-request | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/push-to-pull-request b/tools/push-to-pull-request index 2f02dcafa1..b034822421 100755 --- a/tools/push-to-pull-request +++ b/tools/push-to-pull-request @@ -57,11 +57,15 @@ if [ "$(pr_jq -r .message)" = "Not Found" ]; then fi if [ "$(pr_jq .maintainer_can_modify)" != "true" ]; then - # This seems to be rare (in Greg's experience doing the manual - # equivalent of this script for many different contributors, none - # have ever chosen this setting), but give a decent error message - # if it does happen. - echo "error: contributor has disallowed pushing to PR branch" >&2 + # This happens when the PR has already been merged or closed, or + # if the contributor has turned off the (default) setting to allow + # maintainers of the target repo to push to their PR branch. + # + # The latter seems to be rare (in Greg's experience doing the + # manual equivalent of this script for many different + # contributors, none have ever chosen this setting), but give a + # decent error message if it does happen. + echo "error: PR already closed, or contributor has disallowed pushing to branch" >&2 exit 1 fi