Commit 2e081a3c authored by Samuel E. Giddins's avatar Samuel E. Giddins

Allows the usage of `:head` dependencies even when the most recent published…

Allows the usage of `:head` dependencies even when the most recent published version was a pre-release.

Closes https://github.com/CocoaPods/CocoaPods/issues/3212.
parent c2eabdb0
......@@ -16,6 +16,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Marius Rackwitz](https://github.com/mrackwitz)
[#3217](https://github.com/CocoaPods/CocoaPods/issues/3217)
* Allows the usage of `:head` dependencies even when the most recent published
version was a pre-release.
[Samuel Giddins](https://github.com/segiddins)
[#3212](https://github.com/CocoaPods/CocoaPods/issues/3212)
## 0.36.0.rc.1
......
......@@ -180,7 +180,7 @@ module Pod
end
requirement_satisfied && !(
spec.version.prerelease? &&
existing_vertices.flat_map(&:requirements).none? { |r| r.prerelease? || r.external_source }
existing_vertices.flat_map(&:requirements).none? { |r| r.prerelease? || r.external_source || r.head? }
)
end
......
......@@ -287,6 +287,25 @@ module Pod
]
end
it 'allows pre-release spec versions when a requirement has a ' \
'HEAD source' do
@podfile = Podfile.new do
platform :ios
pod 'MainSpec', :head
end
spec = Spec.new do |s|
s.name = 'MainSpec'
s.version = '1.2.3-pre'
s.platform = :ios
end
resolver = Resolver.new(config.sandbox, @podfile, empty_graph, SourcesManager.all)
resolver.expects(:find_cached_set).returns(Specification::Set::Head.new(spec))
specs = resolver.resolve.values.flatten.map(&:to_s).sort
specs.should == [
'MainSpec (HEAD based on 1.2.3-pre)',
]
end
it "marks a specification's version to be a HEAD version" do
podfile = Podfile.new do
platform :ios
......
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