aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-07-25 10:42:47 -0500
committerJack Nagel2014-07-25 12:28:05 -0500
commit87b4b6fb7d2b2921371da53a9407ee93c04d2b31 (patch)
treec64a9d3ea0c16f9e2c4576486d5e3af62d884a20
parent432181671c6f82f2525a313cd1fa89ab8d60d609 (diff)
downloadhomebrew-87b4b6fb7d2b2921371da53a9407ee93c04d2b31.tar.bz2
update: remove unused rename detection
Right now this code only produces false positives. When we have real support for renames, we can implement it more carefully. Closes #31126.
-rw-r--r--Library/Homebrew/cmd/update.rb9
-rw-r--r--Library/Homebrew/test/fixtures/updater_fixture.yaml1
-rw-r--r--Library/Homebrew/test/test_updater.rb5
3 files changed, 4 insertions, 11 deletions
diff --git a/Library/Homebrew/cmd/update.rb b/Library/Homebrew/cmd/update.rb
index 5fe9341af..5addb4375 100644
--- a/Library/Homebrew/cmd/update.rb
+++ b/Library/Homebrew/cmd/update.rb
@@ -172,12 +172,8 @@ class Updater
map = Hash.new{ |h,k| h[k] = [] }
if initial_revision && initial_revision != current_revision
- `git diff-tree -r --name-status -M85% #{initial_revision} #{current_revision}`.each_line do |line|
- status, path, renamed = line.split
- if renamed
- status = status[0, 1]
- path = renamed
- end
+ `git diff-tree -r --name-status --diff-filter=AMD #{initial_revision} #{current_revision}`.each_line do |line|
+ status, path = line.split
map[status.to_sym] << repository.join(path)
end
end
@@ -226,7 +222,6 @@ class Report
dump_formula_report :A, "New Formulae"
dump_formula_report :M, "Updated Formulae"
dump_formula_report :D, "Deleted Formulae"
- dump_formula_report :R, "Renamed Formulae"
end
def tapped_formula_for key
diff --git a/Library/Homebrew/test/fixtures/updater_fixture.yaml b/Library/Homebrew/test/fixtures/updater_fixture.yaml
index ed86d5c89..f39f3a82b 100644
--- a/Library/Homebrew/test/fixtures/updater_fixture.yaml
+++ b/Library/Homebrew/test/fixtures/updater_fixture.yaml
@@ -12,7 +12,6 @@ update_git_diff_output_with_formulae_changes: |
A Library/Formula/ddrescue.rb
A Library/Formula/dict.rb
A Library/Formula/lua.rb
- R094 Library/Formula/shapefile.rb Library/Formula/shapelib.rb
M Library/Formula/xar.rb
M Library/Formula/yajl.rb
M Library/Homebrew/ARGV+yeast.rb
diff --git a/Library/Homebrew/test/test_updater.rb b/Library/Homebrew/test/test_updater.rb
index 5c6c6c4ef..28ce48ad0 100644
--- a/Library/Homebrew/test/test_updater.rb
+++ b/Library/Homebrew/test/test_updater.rb
@@ -56,7 +56,7 @@ class UpdaterTests < Homebrew::TestCase
@updater.in_repo_expect("git config core.autocrlf false")
@updater.in_repo_expect("git pull -q origin refs/heads/master:refs/remotes/origin/master")
@updater.in_repo_expect("git rev-parse -q --verify HEAD", "3456cdef")
- @updater.in_repo_expect("git diff-tree -r --name-status -M85% 1234abcd 3456cdef", diff_output)
+ @updater.in_repo_expect("git diff-tree -r --name-status --diff-filter=AMD 1234abcd 3456cdef", diff_output)
@updater.pull!
@report.update(@updater.report)
end
@@ -73,7 +73,7 @@ class UpdaterTests < Homebrew::TestCase
assert_predicate @updater, :expectations_met?
assert_empty @report.select_formula(:M)
assert_empty @report.select_formula(:A)
- assert_empty @report.select_formula(:R)
+ assert_empty @report.select_formula(:D)
end
def test_update_homebrew_with_formulae_changes
@@ -81,7 +81,6 @@ class UpdaterTests < Homebrew::TestCase
assert_predicate @updater, :expectations_met?
assert_equal %w{ xar yajl }, @report.select_formula(:M)
assert_equal %w{ antiword bash-completion ddrescue dict lua }, @report.select_formula(:A)
- assert_equal %w{ shapelib }, @report.select_formula(:R)
end
def test_update_homebrew_with_tapped_formula_changes