From 845c4b7f2f7e050b1495051f91b7246b8af89f4a Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Fri, 11 Jul 2014 16:12:34 -0500 Subject: brew-pull: use git to do the diff filtering --- Library/Contributions/cmd/brew-pull.rb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'Library') diff --git a/Library/Contributions/cmd/brew-pull.rb b/Library/Contributions/cmd/brew-pull.rb index 975ba9164..c8bc74049 100755 --- a/Library/Contributions/cmd/brew-pull.rb +++ b/Library/Contributions/cmd/brew-pull.rb @@ -87,19 +87,15 @@ ARGV.named.each do |arg| end Utils.popen_read( - "git", "diff-tree", "-r", "--name-status", - revision, "HEAD", "--", formula_dir, &:read + "git", "diff-tree", "-r", "--name-only", + "--diff-filter=AM", revision, "HEAD", "--", formula_dir ).each_line do |line| - status, filename = line.split - # Don't try and do anything to removed files. - if status == "A" || status == "M" - name = File.basename(filename, ".rb") - - begin - changed_formulae << Formula[name] - rescue FormulaUnavailableError - next - end + name = File.basename(line.chomp, ".rb") + + begin + changed_formulae << Formula[name] + rescue FormulaUnavailableError + next end end -- cgit v1.2.3