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 ...@@ -11,8 +11,7 @@ module Pod
https://github.com/CocoaPods/Specs https://github.com/CocoaPods/Specs
If the clone already exists, it will ensure that it points to the correct If the clone already exists, it will ensure that it is up-to-date.}
remote.}
end end
def initialize(argv) def initialize(argv)
...@@ -28,12 +27,17 @@ module Pod ...@@ -28,12 +27,17 @@ module Pod
end end
def update_master_repo_remote_command 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 end
def run def run
if (config.repos_dir + 'master').exist? if (config.repos_dir + 'master').exist?
update_master_repo_remote_command.run update_master_repo_remote_command.run
update_master_repo_command.run
else else
add_master_repo_command.run add_master_repo_command.run
end end
......
...@@ -11,16 +11,6 @@ describe "Pod::Command" do ...@@ -11,16 +11,6 @@ describe "Pod::Command" do
git_config('master', 'remote.origin.url').should == fixture('spec-repos/master').to_s git_config('master', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end 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 it "adds a spec-repo" do
add_repo('private', fixture('spec-repos/master')) add_repo('private', fixture('spec-repos/master'))
git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s 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