Commit 332e7bb8 authored by Kyle Fuller's avatar Kyle Fuller

Merge pull request #3051 from clarkda/master

[Analyzer] Only update git sourced spec repos
parents e5e9252a fcf06acd
...@@ -47,6 +47,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -47,6 +47,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Hugo Tunius](https://github.com/K0nserv) [Hugo Tunius](https://github.com/K0nserv)
[#2823](https://github.com/CocoaPods/CocoaPods/issues/2823) [#2823](https://github.com/CocoaPods/CocoaPods/issues/2823)
* When updating spec repositories only update the git sourced repos.
[Dustin Clark](https://github.com/clarkda)
[#2558](https://github.com/CocoaPods/CocoaPods/issues/2558)
## 0.36.0.beta.1 ## 0.36.0.beta.1
......
...@@ -163,12 +163,18 @@ module Pod ...@@ -163,12 +163,18 @@ module Pod
end end
end end
# Updates the source repositories unless the config indicates to skip it. # Updates the git source repositories unless the config indicates to skip it.
# #
def update_repositories_if_needed def update_repositories_if_needed
unless config.skip_repo_update? unless config.skip_repo_update?
UI.section 'Updating spec repositories' do UI.section 'Updating spec repositories' do
sources.each { |source| SourcesManager.update(source.name) } sources.each do |source|
if SourcesManager.git_repo?(source.repo)
SourcesManager.update(source.name)
else
UI.message "Skipping `#{source.name}` update because the repository is not a git source repository."
end
end
end end
end end
end end
......
...@@ -71,6 +71,32 @@ module Pod ...@@ -71,6 +71,32 @@ module Pod
@analyzer.analyze @analyzer.analyze
end end
it 'does not update non-git repositories' do
tmp_directory = '/private/tmp/CocoaPods/'
FileUtils.mkdir_p(tmp_directory)
FileUtils.cp_r(ROOT + 'spec/fixtures/spec-repos/test_repo/', tmp_directory)
non_git_repo = tmp_directory + 'test_repo'
podfile = Podfile.new do
platform :ios, '8.0'
xcodeproj 'SampleProject/SampleProject'
pod 'BananaLib', '1.0'
end
config.skip_repo_update = false
config.verbose = true
source = Source.new(non_git_repo)
SourcesManager.expects(:update).never
analyzer = Pod::Installer::Analyzer.new(config.sandbox, podfile, nil)
analyzer.stubs(:sources).returns([source])
analyzer.analyze
UI.output.should.match /Skipping `#{source.name}` update because the repository is not a git source repository./
FileUtils.rm_rf(non_git_repo)
end
#--------------------------------------# #--------------------------------------#
it 'generates the libraries which represent the target definitions' do it 'generates the libraries which represent the target definitions' do
......
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