Skip to content

Commit dda16cf

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

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.config/nextest.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ status-level = "skip"
2020
# Run this profile before other tests to warmup the cache of clang tools binaries.
2121
default-filter = 'test(#*eval_version)'
2222

23+
# only show the job(s) being run in this profile
24+
status-level = "pass"
25+
2326
[profile.ci]
2427
# A profile to run only tests that use clang-tidy and/or clang-format
2528
# NOTE: This profile is intended to keep CI runtime low. Locally, use default or all profiles

cpp-linter/src/git.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,16 @@ 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+
eprintln!("Canonical patch path: {:?}", canonical_patch_path);
151+
let patch_path = canonical_patch_path
152+
.to_str()
153+
.unwrap()
154+
// on Windows, canonical paths can have a prefix of "\\?\" which git does not recognize
155+
.trim_start_matches("\\\\?\\");
156+
eprintln!("Applying patch from path: {patch_path}");
150157
let ok = Command::new("git")
151-
.args(["apply", "--index", canonical_path_path.to_str().unwrap()])
158+
.args(["apply", "--index", patch_path])
152159
.current_dir(path)
153160
.status()
154161
.expect("Failed to apply patch and stage its changes");

0 commit comments

Comments
 (0)