tools: do not mask errors on multiple commit retrieval

In commit-queue.sh, the assignment to `commits` will succeed and the
script will continue if one of the two `git` commands fails, even with
`-e` set. Split it into three separate assignments so that failures in
the `git` commands will be clearly logged and cause the script to exit
with a failure status code.

PR-URL: https://github.com/nodejs/node/pull/41340
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
Rich Trott authored and GitHub committed 2021-12-30 05:57:57 +00:00
1 parent 26c973d4b3
commit e7a924e086
1 file changed
+3 -1
+3 -1
View File
@@ -72,7 +72,9 @@ for pr in "$@"; do
fi
if [ -z "$MULTIPLE_COMMIT_POLICY" ]; then
commits="$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)...$(git rev-parse HEAD)"
start_sha=$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)
end_sha=$(git rev-parse HEAD)
commits="${start_sha}...${end_sha}"
if ! git push $UPSTREAM $DEFAULT_BRANCH >> output 2>&1; then
commit_queue_failed "$pr"