Merge pull request #502 from rustic-rs/dunce

windows: treat UNC paths
This commit is contained in:
aawsome 2023-03-17 22:21:33 +01:00 committed by GitHub
commit 49eace7eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 1 deletions

7
Cargo.lock generated
View File

@ -597,6 +597,12 @@ dependencies = [
"winapi",
]
[[package]]
name = "dunce"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c"
[[package]]
name = "either"
version = "1.8.1"
@ -1757,6 +1763,7 @@ dependencies = [
"derive_more",
"directories",
"dirs",
"dunce",
"enum-map",
"enum-map-derive",
"filetime",

View File

@ -81,6 +81,7 @@ rpassword = "7"
bytesize = "1"
indicatif = "0.17"
path-dedot = "3"
dunce = "1"
gethostname = "0.4"
humantime = "2"
itertools = "0.10"

View File

@ -7,6 +7,7 @@ use anyhow::{anyhow, bail, Result};
use chrono::{DateTime, Duration, Local};
use clap::{AppSettings, Parser};
use derivative::Derivative;
use dunce::canonicalize;
use gethostname::gethostname;
use indicatif::ProgressBar;
use itertools::Itertools;
@ -634,7 +635,7 @@ impl PathList {
}
if self.0.iter().any(|p| p.is_absolute()) {
for path in &mut self.0 {
*path = path.canonicalize()?;
*path = canonicalize(&path)?;
}
}
Ok(())