Skip to content

Commit

Permalink
Merge pull request #69 from epage/dunce
Browse files Browse the repository at this point in the history
fix(win): Strip of UNC path pefix
  • Loading branch information
epage authored Mar 16, 2023
2 parents 68e3e98 + 07dac1e commit f0af959
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ serde = { version = "1.0.152", features = ["derive"] }
flate2 = "1.0.25"
once_cell = "1.17.0"
bugreport = "0.5.0"
dunce = "1.0.3"

[dev-dependencies]
snapbox = { version = "0.4.10", features = ["path"] }
Expand Down
3 changes: 1 addition & 2 deletions src/blame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,7 @@ fn to_repo_relative(
let workdir = repo.workdir().ok_or_else(|| {
anyhow::format_err!("No workdir found; Bare repositories are not supported")
})?;
let abs_path = path
.canonicalize()
let abs_path = dunce::canonicalize(path)
.with_context(|| anyhow::format_err!("Could not read {}", path.display()))?;
let rel_path = abs_path.strip_prefix(workdir).map_err(|_| {
anyhow::format_err!(
Expand Down

0 comments on commit f0af959

Please sign in to comment.