Commit 9258cd3a authored by Boris Bügling's avatar Boris Bügling

Merge pull request #2973 from CocoaPods/issue/2965

[Source Manager] Fix issue with source without URL
parents 44e3dab4 0ac712f0
......@@ -76,6 +76,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.
[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
......
......@@ -395,7 +395,9 @@ module Pod
#
def source_with_url(url)
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
# Returns a suitable repository name for `url`.
......
......@@ -205,6 +205,13 @@ module Pod
SourcesManager.find_or_create_source_with_url('https://github.com/artsy/Specs.git').
should == 'Source'
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
......
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