Skip to content

Commit 4b40e68

Browse files
committed
cmd/check-bottle-modification: fix handling of removed files
We don't need to error out here if a formula is removed. This is also fixes handling of formula renames. See, for example, #230744 or #230831.
1 parent a6423c3 commit 4b40e68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cmd/check-bottle-modification.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ def commit_modifies_bottle_block?(sha)
3838

3939
files = response.fetch("files")
4040
files.reject! do |file|
41-
filename = file.fetch("filename")
41+
next true if file.fetch("status") == "removed"
4242

43-
!filename.start_with?("Formula") || !filename.end_with?(".rb")
43+
filename = file.fetch("filename")
44+
!filename.start_with?("Formula/") || !filename.end_with?(".rb")
4445
end
4546

4647
files.any? { |file| patch_modifies_bottle_block?(file.fetch("patch")) }

0 commit comments

Comments
 (0)