Commit 7ee1cbad authored by Eloy Duran's avatar Eloy Duran

Update the master spec repo after running `pod setup' and the repo already exists. Closes #67.

parent c7092107
......@@ -11,8 +11,7 @@ module Pod
https://github.com/CocoaPods/Specs
If the clone already exists, it will ensure that it points to the correct
remote.}
If the clone already exists, it will ensure that it is up-to-date.}
end
def initialize(argv)
......@@ -28,12 +27,17 @@ module Pod
end
def update_master_repo_remote_command
@command ||= Repo.new(ARGV.new(['set-url', 'master', master_repo_url]))
Repo.new(ARGV.new(['set-url', 'master', master_repo_url]))
end
def update_master_repo_command
Repo.new(ARGV.new(['update', 'master']))
end
def run
if (config.repos_dir + 'master').exist?
update_master_repo_remote_command.run
update_master_repo_command.run
else
add_master_repo_command.run
end
......
......@@ -11,16 +11,6 @@ describe "Pod::Command" do
git_config('master', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end
it "updates an existing `master' clone to point to the correct remote (migration for version 0.2.0 -> 0.3.0)" do
dir = temporary_directory + 'cocoapods'
dir.mkpath
FileUtils.cp_r(fixture('spec-repos/master').to_s, dir.to_s)
command = Pod::Command.parse('setup', '--silent')
def command.master_repo_url; 'git://some-other-remote'; end
command.run
git_config('master', 'remote.origin.url').should == 'git://some-other-remote'
end
it "adds a spec-repo" do
add_repo('private', fixture('spec-repos/master'))
git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment