Skip to content

Commit

Permalink
Fix bug with path matching on git dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Jul 26, 2024
1 parent f442e4d commit d7ba472
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/diag/krate_spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,10 @@ fn read_workspace_deps<'k>(
}),
Source::Git { repo, spec: dspec },
) => {
if url.host_str() != repo.host_str() || url.path() != repo.path() {
if url.host_str() != repo.host_str()
|| url.path().trim_end_matches(".git")
!= repo.path().trim_end_matches(".git")
{
return None;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/bans__deny_duplicate_workspace_items.snap
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ expression: diags
"span": "spdx-git"
},
{
"column": 87,
"column": 91,
"line": 19,
"message": "note the workspace dependency is renamed",
"span": "spdx"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data/workspace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spdx = "0.10"
# Validates that we recognize the workspace dependency exists even though it is renamed
spdx-old = { version = "0.9", package = "spdx" }
spdx-very-old = { version = "0.8", package = "spdx" }
spdx-git = { git = "https://github.com/EmbarkStudios/spdx", tag = "0.7.0", package = "spdx" }
spdx-git = { git = "https://github.com/EmbarkStudios/spdx.git", tag = "0.7.0", package = "spdx" }
member-one = { path = "crates/member-one" }
member-two = { path = "crates/member-two" }
# Validates we can find workspace dependency sources from non-crates.io registries
Expand Down

0 comments on commit d7ba472

Please sign in to comment.