Skip to content

Commit 4bdfc77

Browse files
committed
chore(verify-commits): initialize variable
1 parent 5bd4cad commit 4bdfc77

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/verify_commits.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,15 @@ function upstream_ref() {
6060

6161

6262
local invalid
63+
invalid=false
6364
if (( ${#upstream_repos[@]} != 1 )); then
64-
err "downstream staging commit ${downstream_commit} references an invalid number of repos:"
65-
err "${upstream_repos[@]}"
65+
err "downstream staging commit ${downstream_commit} references an invalid number of repos: ${#upstream_repos[@]}"
6666
err "staging commits must reference a single upstream repo"
6767
invalid=true
6868
fi
6969

7070
if (( ${#upstream_commits[@]} != 1 )); then
71-
err "downstream staging commit ${downstream_commit} references an invalid number of upstream commits:"
72-
err "${upstream_commits[@]}"
71+
err "downstream staging commit ${downstream_commit} references an invalid number of upstream commits: ${#upstream_commits[@]}"
7372
err "staging commits must reference a single upstream commit"
7473
invalid=true
7574
fi
@@ -121,7 +120,7 @@ function main() {
121120
info "verifying ${short}..."
122121
info "$(git log -n 1 "${commit}")"
123122

124-
mapfile -t sr < <(upstream_ref "${commit}" || exit 1)
123+
sr=( $(upstream_ref "${commit}") ) || exit 1
125124
if (( ${#sr[@]} < 2 )); then # the ref contains a tuple if the values were properly parsed from the commit message
126125
# couldn't find upstream cherry-pick reference in the commit message
127126
# assume it's downstream-only commit

0 commit comments

Comments
 (0)