From e0ff91c636d44870f978616784690d65b867a9d0 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Thu, 30 May 2024 20:00:40 +0300 Subject: [PATCH] chore(scripts): fix expression interpreted as exit code on some Bash versions --- scripts/release/check_commit_metadata.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/release/check_commit_metadata.sh b/scripts/release/check_commit_metadata.sh index ff1d61b512ebe..def18071af019 100755 --- a/scripts/release/check_commit_metadata.sh +++ b/scripts/release/check_commit_metadata.sh @@ -122,7 +122,7 @@ main() { fi if [[ ${title1} != "${title2}" ]]; then - log "Invariant failed, cherry-picked commits have different titles: ${title1} != ${title2}, attempting to check commit body for cherry-pick information..." + log "Invariant failed, cherry-picked commits have different titles: \"${title1%$'\n'}\" != \"${title2%$'\n'}\", attempting to check commit body for cherry-pick information..." renamed=$(git show "${commit1}" | sed -ne 's/.*cherry picked from commit \([0-9a-f]*\).*/\1/p') if [[ -n ${renamed} ]]; then @@ -130,12 +130,11 @@ main() { renamed_cherry_pick_commits[${commit1}]=${renamed} renamed_cherry_pick_commits[${renamed}]=${commit1} continue - else - log "Not a cherry-pick commit, adding ${commit1} to pending list..." - renamed_cherry_pick_commits_pending+=("${commit1}") fi - # error "Invariant failed, cherry-picked commits have different titles: ${title1} != ${title2}" - ((i--)) + + log "Not a cherry-pick commit, adding ${commit1} to pending list..." + renamed_cherry_pick_commits_pending+=("${commit1}") + i=$((i - 1)) continue fi