Skip to content

Commit fb218b2

Browse files
authored
Fix regex escaping for [ and ] in sync-release-branch.sh (stackrox/rox#8858)
1 parent db6860c commit fb218b2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/sync-release-branch.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ for milestone in "${milestones[@]}"; do
135135
# commit messages, and somebody eliminating the PR# from the commit message), additionally check if
136136
# the diffs (with context removed) look the same.
137137
firstline="$(git log "${commit_id}...${commit_id}^" --format='%s')"
138-
firstline_search="${firstline//[/\[}"
139-
firstline_search="${firstline_search//]/\]}"
138+
firstline_search="${firstline//\[/\\[}"
139+
firstline_search="${firstline_search//\]/\\]}"
140140
firstline_match_commit="$(git log --grep "^${firstline_search}\$" --format='%H')"
141141
if [[ -n "$firstline_match_commit" ]]; then
142142
if cmp -s \

0 commit comments

Comments
 (0)