-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: normalize path separators in git submodule URL lookup #11826
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
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.
@wellnana Can we use dunce::canonicalize
on the paths
returned here: https://github.com/wellnana/foundry/blob/85587aa848a5cbddf5720495583e1551e40a2f05/crates/forge/src/cmd/remove.rs#L34
Thanks for the review @onbjerg ! I've updated the code per your suggestions - removed the path separator replacement and now rely only on |
doesn't seem to work |
crates/forge/src/cmd/remove.rs
Outdated
pub fn run(self) -> Result<()> { | ||
let config = self.load_config()?; | ||
let (root, paths, _) = super::update::dependencies_paths(&self.dependencies, &config)?; | ||
let (root, mut paths, _) = super::update::dependencies_paths(&self.dependencies, &config)?; |
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.
shouldn't this be done inside of the function?
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.
updated in 613462a
issue here is that the command should be > git config --get submodule.lib/forge-std.url
https://github.com/foundry-rs/forge-std but on win path was git config --get submodule.lib\forge-std.url returned nothing |
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.
lgtm, thank you, pending one more review CC @onbjerg
Git always uses forward slashes in submodule config keys, even on Windows, so we need to normalize the path separators before looking up the URL.
This also fixed flaky test.
Might be the reason why the test is failing during #11437 (review) cc @onbjerg