brew-pull: use git to do the diff filtering

This commit is contained in:
Jack Nagel 2014-07-11 16:12:34 -05:00
parent 5c24b7330b
commit 845c4b7f2f

View File

@ -87,19 +87,15 @@ ARGV.named.each do |arg|
end end
Utils.popen_read( Utils.popen_read(
"git", "diff-tree", "-r", "--name-status", "git", "diff-tree", "-r", "--name-only",
revision, "HEAD", "--", formula_dir, &:read "--diff-filter=AM", revision, "HEAD", "--", formula_dir
).each_line do |line| ).each_line do |line|
status, filename = line.split name = File.basename(line.chomp, ".rb")
# Don't try and do anything to removed files.
if status == "A" || status == "M"
name = File.basename(filename, ".rb")
begin begin
changed_formulae << Formula[name] changed_formulae << Formula[name]
rescue FormulaUnavailableError rescue FormulaUnavailableError
next next
end
end end
end end