Closed keith closed 6 years ago
I don't think this is an acceptable change -- it will mean downloading pretty much every released pod requires an unshallow clone. Instead, why don't we try downloading with --branch
, check if git describe HEAD --tags
== tag
, and if not fall back to the unshallow clone?
That sounds reasonable to me, it looks like git describe --tags
only returns a single tag if there are multiple pointing to a commit, it looks like git tag --points-at HEAD
will work though. Is there any example currently of us capturing output from git commands?
Side note, if we don't think any overhead is worth doing this, since force pushing a tag has the same issue and also isn't guarded against, we can just toss this for now. Thoughts?
target_git
will return the output from the git command
Ah it looks like that returns a bool if there is no output, which is what confused me
Ah nevermind it looks like we're stubbing this out in tests.
Submitted https://github.com/CocoaPods/cocoapods-downloader/pull/73 in place of this
Previously if you had a repo with a branch and a tag with the same name, using
git clone --branch
would prefer the branch, which may or may not be the same source as the tag. Now we checkout the tag unambiguously. The biggest downside here is we no longer do a shallow clone in this case.