aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2014-07-26 20:11:53 -0500
committerJack Nagel2014-07-26 20:11:53 -0500
commit802775078c2d91f231eb4b0f64685c01d998dee8 (patch)
treec298de9aee39958b31cca962e76aec7c739072b5 /Library/Homebrew/cmd
parent6baf357f8c196dcf26cc3f4a877bd992dbb55e3a (diff)
downloadbrew-802775078c2d91f231eb4b0f64685c01d998dee8.tar.bz2
Separate reading and parsing the diff
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/update.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 5addb4375..85cc3014b 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -172,7 +172,7 @@ class Updater
map = Hash.new{ |h,k| h[k] = [] }
if initial_revision && initial_revision != current_revision
- `git diff-tree -r --name-status --diff-filter=AMD #{initial_revision} #{current_revision}`.each_line do |line|
+ diff.each_line do |line|
status, path = line.split
map[status.to_sym] << repository.join(path)
end
@@ -187,6 +187,10 @@ class Updater
`git rev-parse -q --verify HEAD`.chomp
end
+ def diff
+ `git diff-tree -r --name-status --diff-filter=AMD #{initial_revision} #{current_revision}`
+ end
+
def `(cmd)
out = super
if $? && !$?.success?