Skip to content

Commit 0a045b8

Browse files
committed
strip annoying file protocol prefix
for windows canonical path to git test patch asset
1 parent 30e0efe commit 0a045b8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

cpp-linter/src/git.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ mod test {
146146
}
147147
}
148148
if let Some(patch) = patch_path {
149-
let canonical_path_path = fs::canonicalize(patch).unwrap();
149+
let canonical_patch_path = fs::canonicalize(patch).unwrap();
150+
let patch_path = canonical_patch_path
151+
.to_str()
152+
.unwrap()
153+
.trim_start_matches("//?/");
150154
let ok = Command::new("git")
151-
.args(["apply", "--index", canonical_path_path.to_str().unwrap()])
155+
.args(["apply", "--index", patch_path])
152156
.current_dir(path)
153157
.status()
154158
.expect("Failed to apply patch and stage its changes");

0 commit comments

Comments
 (0)