Commit b3642727 authored by Brad Taylor's avatar Brad Taylor Committed by Eloy Durán

Run git submodule update after initial clone

Some repositories require that submodules be initialized and updated to
be properly built.  This is now done during the download phase for every
repository.
parent 7fc60b51
......@@ -76,6 +76,7 @@ module Pod
git "reset --hard HEAD"
git "clean -d -x -f"
git "pull"
git "submodule update"
end
end
......@@ -111,6 +112,7 @@ module Pod
git "fetch origin tags/#{options[:tag]}"
git "reset --hard FETCH_HEAD"
git "checkout -b activated-pod-commit"
git "submodule update --init"
end
end
......@@ -135,6 +137,9 @@ module Pod
def clone(from, to)
git "clone \"#{from}\" \"#{to}\""
Dir.chdir(to) do
git "submodule update --init"
end
end
end
......
......@@ -39,6 +39,28 @@ module Pod
(@pod.root + 'README').read.strip.should == 'v1.0'
end
it "initializes submodules when checking out a specific commit" do
@pod.top_specification.stubs(:source).returns(
:git => fixture('banana-lib'), :commit => '6cc9afc'
)
downloader = Downloader.for_pod(@pod)
downloader.download
(@pod.root + 'README').read.strip.should == 'post v1.0'
(@pod.root + 'libPusher/README.md').read.strip.should.match /^libPusher/
end
it "initializes submodules when checking out a specific tag" do
@pod.top_specification.stubs(:source).returns(
:git => fixture('banana-lib'), :tag => 'v1.1'
)
downloader = Downloader.for_pod(@pod)
downloader.download
(@pod.root + 'README').read.strip.should == 'post v1.0'
(@pod.root + 'libPusher/README.md').read.strip.should.match /^libPusher/
end
it "prepares the cache if it does not exits" do
@pod.top_specification.stubs(:source).returns(
:git => fixture('banana-lib'), :commit => 'fd56054'
......
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