Skip to content
Snippets Groups Projects
Commit 8d12684e authored by Jack Nagel's avatar Jack Nagel
Browse files

Pass repository path into the updater

parent 61e63342
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ module Homebrew
unlink_tap_formula(tapped_formulae)
report = Report.new
master_updater = Updater.new
master_updater = Updater.new(HOMEBREW_REPOSITORY)
begin
master_updater.pull!
ensure
......@@ -39,7 +39,7 @@ module Homebrew
each_tap do |user, repo|
repo.cd do
updater = Updater.new
updater = Updater.new(repo)
begin
updater.pull!
......@@ -135,7 +135,11 @@ module Homebrew
end
class Updater
attr_reader :initial_revision, :current_revision
attr_reader :initial_revision, :current_revision, :repository
def initialize(repository)
@repository = repository
end
def pull!
safe_system "git", "checkout", "-q", "master"
......@@ -178,7 +182,7 @@ class Updater
when :R then $3
else $2
end
map[status] << Pathname.pwd.join(path)
map[status] << repository.join(path)
end
end
......
......@@ -4,7 +4,7 @@ require 'yaml'
class UpdaterTests < Homebrew::TestCase
class UpdaterMock < ::Updater
def initialize(*args)
def initialize(*)
super
@outputs = Hash.new { |h, k| h[k] = [] }
@expected = []
......@@ -42,7 +42,7 @@ class UpdaterTests < Homebrew::TestCase
end
def setup
@updater = UpdaterMock.new
@updater = UpdaterMock.new(HOMEBREW_REPOSITORY)
@report = Report.new
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment