File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,8 +130,15 @@ file_matches_filter() {
130130}
131131
132132is_changed () {
133- [ -f " $CHANGED_LINES_CACHE " ] && grep -q " ^$1 :$2 $" " $CHANGED_LINES_CACHE " && return 0
134- [ -f " $CHANGED_FILES_CACHE " ] && grep -q " ^$1 $" " $CHANGED_FILES_CACHE " && return 0
133+ local file=" $1 "
134+ local line=" $2 "
135+
136+ if [ -z " $line " ]; then
137+ [ -f " $CHANGED_FILES_CACHE " ] && grep -qF " $file " " $CHANGED_FILES_CACHE " && return 0
138+ return 1
139+ fi
140+
141+ [ -f " $CHANGED_LINES_CACHE " ] && grep -qF " ${file} :${line} " " $CHANGED_LINES_CACHE " && return 0
135142 return 1
136143}
137144
@@ -196,7 +203,7 @@ check_blocking_rules() {
196203 cat " $CHANGED_FILES_CACHE " 2> /dev/null || echo " (cache vazio)"
197204 echo " "
198205
199- while IFS=: read -r file line rest; do
206+ echo " $p1_violations " | while IFS=: read -r file line rest; do
200207 [ -z " $file " ] && continue
201208 file_matches_filter " $file " || continue
202209
@@ -217,9 +224,11 @@ check_blocking_rules() {
217224 exit 1
218225 fi
219226 fi
220- done << EOF
221- $p1_violations
222- EOF
227+ done
228+
229+ if [ $? -eq 1 ]; then
230+ exit 1
231+ fi
223232
224233 echo " ✅ P1s existem mas fora das linhas alteradas → merge permitido"
225234}
You can’t perform that action at this time.
0 commit comments