Commit 0ac712f0 authored by Kyle Fuller's avatar Kyle Fuller

[Source Manager] Fix issue with source without URL

Closes #2965
parent aab11a84
...@@ -72,6 +72,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -72,6 +72,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Fix an issue when a user doesn't yet have any spec repositories configured. * Fix an issue when a user doesn't yet have any spec repositories configured.
[Boris Bügling](https://github.com/neonichu) [Boris Bügling](https://github.com/neonichu)
* Fix an issue updating repositories when another spec repository doesn't
have a remote.
[Kyle Fuller](https://github.com/kylef)
[#2965](https://github.com/CocoaPods/CocoaPods/issues/2965)
## 0.35.0 ## 0.35.0
......
...@@ -395,7 +395,9 @@ module Pod ...@@ -395,7 +395,9 @@ module Pod
# #
def source_with_url(url) def source_with_url(url)
url = url.downcase.gsub(/.git$/, '') url = url.downcase.gsub(/.git$/, '')
aggregate.sources.find { |s| s.url.downcase.gsub(/.git$/, '') == url } aggregate.sources.find do |source|
source.url && source.url.downcase.gsub(/.git$/, '') == url
end
end end
# Returns a suitable repository name for `url`. # Returns a suitable repository name for `url`.
......
...@@ -205,6 +205,13 @@ module Pod ...@@ -205,6 +205,13 @@ module Pod
SourcesManager.find_or_create_source_with_url('https://github.com/artsy/Specs.git'). SourcesManager.find_or_create_source_with_url('https://github.com/artsy/Specs.git').
should == 'Source' should == 'Source'
end end
it 'handles repositories without a remote url' do # for #2965
Command::Repo::Add.any_instance.stubs(:run).once
Source.any_instance.stubs(:url).returns(nil)
e = lambda { SourcesManager.find_or_create_source_with_url('url') }
e.should.not.raise
end
end end
end end
end end
......
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