-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support sparse checkouts in git Source #649
base: master
Are you sure you want to change the base?
Conversation
@@ -111,7 +111,9 @@ def specs_dir | |||
# stored. | |||
# | |||
def pod_path(name) | |||
specs_dir.join(*metadata.path_fragment(name)) | |||
path = specs_dir.join(*metadata.path_fragment(name)) | |||
add_to_sparse_checkout(path) if sparse_checkout? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it feels very weird to me that simply querying for the path would have side effects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it helps to view it as a "lazy" repo - the code simply ensures that the path can be queried correctly.
If viewed this way, it's not a "side effect" but a necessary implementation detail.
Another way to do this is to add the call to #add_to_sparse_checkout
everywhere the path is being queried, but that increases the risk of bugs. My proposition seems more robust to me.
b90d00f
to
c6aca89
Compare
c6aca89
to
a8b030e
Compare
This year, git and GitHub have added support for sparse checkouts and partial clones.
This PR adds support for these features in the spec repos. If a spec repo is added as a sparse checkout, (addition is handled in CocoaPods#10069), only the pods the user requests are fetched/checked out.