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 Homebrew/homebrew#31126.
This commit is contained in:
Jack Nagel 2014-07-25 10:42:47 -05:00
parent 2cf116464d
commit 6baf357f8c
3 changed files with 4 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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