Skip to content

Commit

Permalink
Merge pull request #13576 from Rylan12/empty-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rylan12 authored Jul 19, 2022
2 parents 30fda55 + 94138c0 commit 19340f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/software_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def recursive_requirements

def patch(strip = :p1, src = nil, &block)
p = Patch.create(strip, src, &block)
return if p.is_a?(ExternalPatch) && p.url.blank?

dependency_collector.add(p.resource) if p.is_a? ExternalPatch
patches << p
end
Expand Down
7 changes: 7 additions & 0 deletions Library/Homebrew/test/software_spec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,12 @@
expect(spec.patches.count).to eq(1)
expect(spec.patches.first.strip).to eq(:p1)
end

it "doesn't add a patch with no url" do
spec.patch do
sha256 "7852a7a365f518b12a1afd763a6a80ece88ac7aeea3c9023aa6c1fe46ac5a1ae"
end
expect(spec.patches.empty?).to be true
end
end
end

0 comments on commit 19340f9

Please sign in to comment.