Fix git features not working when a Windows host collaborates with a unix guest (#43515)
We were using `std::path::Path::strip_prefix` to determine which repository an absolute path belongs to, which doesn't work when the paths are Windows-style but the code is running on unix. Replace it with a platform-agnostic implementation of `strip_prefix`. Release Notes: - Fixed git features not working when a Windows host collaborates with a unix guest
This commit is contained in:
@@ -965,7 +965,7 @@ impl VimCommand {
|
||||
}
|
||||
};
|
||||
|
||||
let rel_path = if args.ends_with(PathStyle::local().separator()) {
|
||||
let rel_path = if args.ends_with(PathStyle::local().primary_separator()) {
|
||||
rel_path
|
||||
} else {
|
||||
rel_path
|
||||
@@ -998,7 +998,7 @@ impl VimCommand {
|
||||
.display(PathStyle::local())
|
||||
.to_string();
|
||||
if dir.is_dir {
|
||||
path_string.push_str(PathStyle::local().separator());
|
||||
path_string.push_str(PathStyle::local().primary_separator());
|
||||
}
|
||||
path_string
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user