-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: fetch nested git submodules #12244
fix: fetch nested git submodules #12244
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
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.
Thank you for filing a patch so fast! Looks pretty good to me :)
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.
Thanks. That's pretty much of it!
@bors r+ |
@bors r- |
fix: git submodules with relative urls ### What does this PR try to resolve? Fixes #12151. When recursing submodules, the url of the parent remote was being passed to `update_submodules` instead of the child remote url. This caused Cargo to try to add the wrong submodule. ### How should we test and review this PR? A test case is added in the first commit. The second one renames the `url` variable as suggested in the issue. The third includes the changes to fix the issue. The last one includes a minor refactor where a redundant `match` expr is removed.
@bors r+ |
☀️ Test successful - checks-actions |
1 similar comment
☀️ Test successful - checks-actions |
👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request. |
Update cargo 12 commits in b0fa79679e717cd077b7fc0fa4166f47107f1ba9..49b6d9e179a91cf7645142541c9563443f64bf2b 2023-06-03 14:19:48 +0000 to 2023-06-09 17:21:19 +0000 - docs: doc comments for all registry kinds (rust-lang/cargo#12247) - chore: Migrate print-ban from test to clippy (rust-lang/cargo#12246) - fix: fetch nested git submodules (rust-lang/cargo#12244) - refactor: registry source cleanup (rust-lang/cargo#12240) - test: loose overly matches for git cli output (rust-lang/cargo#12241) - fix: disable multiplexing on macOS for some versions of curl (rust-lang/cargo#12234) - docs: doc comments for registry source and index (rust-lang/cargo#12239) - doc: point to nightly cargo doc (rust-lang/cargo#12237) - Upgrade to `gix` v0.45 for multi-round pack negotiations. (rust-lang/cargo#12236) - refactor: git source cleanup (rust-lang/cargo#12197) - Add message on reusing previous temporary path on failed cargo installs (rust-lang/cargo#12231) - doc: the first line should be a simple sentence instead of a heading (rust-lang/cargo#12228) r? `@ghost`
`parent_remote_url` used to be `&str` before rust-lang#12244. However, we changed the type to `Url` and it started failing to parse scp-like URLs since they are not compliant with WHATWG URL spec. In this commit, we change it back to `&str` and construct the URL manually. This should be safe since Cargo already checks if it is a relative URL for that if branch.
`parent_remote_url` used to be `&str` before rust-lang#12244. However, we changed the type to `Url` and it started failing to parse scp-like URLs since they are not compliant with WHATWG URL spec. In this commit, we change it back to `&str` and construct the URL manually. This should be safe since Cargo already checks if it is a relative URL for that if branch.
`parent_remote_url` used to be `&str` before rust-lang#12244. However, we changed the type to `Url` and it started failing to parse scp-like URLs since they are not compliant with WHATWG URL spec. In this commit, we change it back to `&str` and construct the URL manually. This should be safe since Cargo already checks if it is a relative URL for that if branch.
What does this PR try to resolve?
Fixes #12151.
When recursing submodules, the url of the parent remote was being passed to
update_submodules
instead of the child remote url. This caused Cargo to try to add the wrong submodule.How should we test and review this PR?
A test case is added in the first commit. The second one renames the
url
variable as suggested in the issue. The third includes the changes to fix the issue. The last one includes a minor refactor where a redundantmatch
expr is removed.