Skip to content

Commit 5fc886f

Browse files
Trotttargos
authored andcommitted
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: #41340 Reviewed-By: Tierney Cyren <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 88d760c commit 5fc886f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/actions/commit-queue.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ for pr in "$@"; do
7272
fi
7373

7474
if [ -z "$MULTIPLE_COMMIT_POLICY" ]; then
75-
commits="$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)...$(git rev-parse HEAD)"
75+
start_sha=$(git rev-parse $UPSTREAM/$DEFAULT_BRANCH)
76+
end_sha=$(git rev-parse HEAD)
77+
commits="${start_sha}...${end_sha}"
7678

7779
if ! git push $UPSTREAM $DEFAULT_BRANCH >> output 2>&1; then
7880
commit_queue_failed "$pr"

0 commit comments

Comments
 (0)