fix: git gets plain Windows paths; the FIFO test is Unix-only (P11c)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s

std::fs::canonicalize on Windows returns \\?\C:\..., which git refuses
("not a git repository"): every argument handed to git now has the
extended-length prefix taken off (root::without_extended_prefix, with a
unit test that runs everywhere; \\?\UNC\ becomes \\). The access-record
test's fixture is a FIFO in the log's place, which Windows has no
counterpart for; the refusal path is the same code on every system, so
the test and its helper are Unix-only. main (8f0e5f08) merged in.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-30 03:13:47 -06:00
1 parent fa7c2805a6
commit 9f57269def
3 files changed
+45 -3

No files matched your search

+7 -1
View File
@@ -223,7 +223,13 @@ impl Git {
fn run(&self, what: &str, args: &[&std::ffi::OsStr]) -> Result<String, BackupError> {
use std::sync::atomic::{AtomicU64, Ordering};
let mut c = self.command();
c.args(args);
// A path made canonical on Windows carries `\\?\`, which git refuses.
c.args(args.iter().map(|a| match a.to_str() {
Some(text) if text.contains(r"\\?\") => {
std::ffi::OsString::from(crate::root::without_extended_prefix(text))
}
_ => (*a).to_os_string(),
}));
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;