Skip to content

[SR-13484] Use --no-checkout when cloning packages, since it's immediately followed by a checkout anyway #2903

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

Conversation

abertelrud
Copy link
Contributor

SwiftPM fetches a remote repository by mirroring it to the local file system, then clones that local repository to a working directory, after which it checks out a specific ref.

When the local clone happens, Git also does a checkout. This is unnecessary, since the checkout will immediately be replaced by the intended ref, and it also makes the checkout sensitive to whether the default branch name is set up correctly for the repository.

Since the working copy is guaranteed to be checked out after the clone, there is no need to do a checkout as part of the cloning.

rdar://68165300

…diately followed by a `checkout` anyway

SwiftPM fetches a remote repository by mirroring it to the local file system, then clones that local repository to a working directory, after which it checks out a specific ref.

When the local clone happens, Git also does a check out.  This is unnecessary, since the checkout will immediately be replaced by the intended ref, and it also makes the checkout sensitive to whether the default branch name is set up correctly for the repository.

Since the working copy is guaranteed to be checked out after the clone, there is no need to do a checkout as part of the cloning.

rdar://68165300
@abertelrud abertelrud marked this pull request as draft September 1, 2020 22:28
@abertelrud
Copy link
Contributor Author

Marking as draft since I expect that there will be some discussion about this.

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud abertelrud marked this pull request as ready for review September 3, 2020 16:58
@abertelrud abertelrud merged commit 605d50e into swiftlang:master Sep 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants