mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 12:09:12 +00:00
Use portable paths for subdirectories in lock URLs (#8707)
## Summary We're writing different URLs on Windows vs. Linux because the subdirectory path is being serialized with a back vs. forward slash.
This commit is contained in:
parent
4a5a79eed8
commit
bed47d512a
3 changed files with 149 additions and 4 deletions
|
@ -3152,9 +3152,15 @@ fn locked_git_url(git_dist: &GitSourceDist) -> Url {
|
|||
url.set_query(None);
|
||||
|
||||
// Put the subdirectory in the query.
|
||||
if let Some(subdirectory) = git_dist.subdirectory.as_deref().and_then(Path::to_str) {
|
||||
if let Some(subdirectory) = git_dist
|
||||
.subdirectory
|
||||
.as_deref()
|
||||
.map(PortablePath::from)
|
||||
.as_ref()
|
||||
.map(PortablePath::to_string)
|
||||
{
|
||||
url.query_pairs_mut()
|
||||
.append_pair("subdirectory", subdirectory);
|
||||
.append_pair("subdirectory", &subdirectory);
|
||||
}
|
||||
|
||||
// Put the requested reference in the query.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue