dev-cmd/pr-pull: fail on syntax errors.

This logic was pulled over from `brew pull` where it made sense (as we
wanted to be able to pull broken commits) but doesn't really apply here
where we can easily end up ignoring broken formulae and pushing their
commits anyway.
This commit is contained in:
Mike McQuaid 2020-08-24 08:44:31 +01:00
parent ed443cc7c7
commit 7e0e458dc2
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -178,16 +178,12 @@ module Homebrew
Utils.popen_read("git", "-C", tap.path, "diff-tree",
"-r", "--name-only", "--diff-filter=AM",
original_commit, "HEAD", "--", tap.formula_dir)
.lines.map do |line|
.lines
.map do |line|
next unless line.end_with? ".rb\n"
name = "#{tap.name}/#{File.basename(line.chomp, ".rb")}"
begin
Formula[name]
rescue Exception # rubocop:disable Lint/RescueException
# Make sure we catch syntax errors.
next
end
Formula[name]
end.compact
end