处理Windows下绝对路径转换产生的"\\\\?\\"前缀

This commit is contained in:
mrbeanc
2023-12-20 16:37:55 +08:00
parent 2255cdaf09
commit ffac740f97
5 changed files with 59 additions and 11 deletions

View File

@@ -47,7 +47,7 @@ pub fn add(files: Vec<String>, all: bool, mut update: bool) {
}
fn add_a_file(file: &Path, index: &mut Index) {
println!("add a file: {}", get_relative_path(file, get_working_dir().unwrap()).display());
println!("add a file: {}", get_relative_path(file, &*get_working_dir().unwrap()).display());
if !file.exists() { //文件被删除
index.remove(file);
} else { //文件存在