CocoaPods / cocoapods-downloader

A small library that provides downloaders for various source types (HTTP/SVN/Git/Mercurial)
MIT License
84 stars 72 forks source link

Explicitly checkout submodules when needed #58

Closed gfontenot closed 8 years ago

gfontenot commented 8 years ago

After doing some research, it looks like git 2.9 made a change so that command line flags are now sent to the submodule commands as well, where pre-2.9 releases ignored those flags for submodules.

That seems like a great change on the surface. But unfortunately for us, it means that using --depth=1 and --recursive in the same command will almost always result in a failed clone. This is because the submodule is also initially checked out using --depth=1 and so when it then tries to check out the commit specified by the .gitmodules file, it fails because it doesn't see that SHA in the git history. The only way it will succeed is if the specified commit also happens to be the HEAD of master.

This issue can be fixed by removing the --recursive flag from the initial git command, and then running git submodules --init --recursive inside the repo to pull down the submodules.

Fixes CocoaPods/CocoaPods#5555

segiddins commented 8 years ago

<3 thanks @gfontenot! Could you slap a quick changelog entry on this? We should backport & release it as 1.0.1

gfontenot commented 8 years ago

Added the changelog entry by ammending the previous commit.

gfontenot commented 8 years ago

Fixed this up by using an actual git command, as opposed to one my dumb brain decided to make up.

gfontenot commented 8 years ago

@segiddins Any idea about a timeframe for getting a release with this? I'm happy to help however I can, I'm blocked locally by it.

segiddins commented 8 years ago

@gfontenot I can try and get around to it today but no promises, in the meantime see https://guides.cocoapods.org/using/unreleased-features.html

segiddins commented 8 years ago

Released

gfontenot commented 8 years ago

🎉 Thanks @segiddins!