test: keep partial-clone fixture on native temp fs

This commit is contained in:
冰朔 2026-09-03 12:02:26 +08:00
commit 31d7200862

View file

@ -389,9 +389,9 @@ fn read_remote_head(remote_url: &str, branch: &str) -> Result<String, String> {
let output = require_success("PERSONA_REMOTE_HEAD_READ", output)?;
let packet_trace = String::from_utf8_lossy(&output.stderr);
if !packet_trace.lines().any(|line| {
line.split_whitespace().any(|token| {
token.starts_with("fetch=") && line.split_whitespace().any(|part| part == "filter")
})
line.split_whitespace()
.any(|token| token.starts_with("fetch="))
&& line.split_whitespace().any(|part| part == "filter")
}) {
return Err("PERSONA_REMOTE_PARTIAL_OBJECT_PROTOCOL_REQUIRED".into());
}
@ -665,7 +665,11 @@ mod tests {
}
fn fixture() -> (TempDir, PathBuf, PathBuf, String) {
let temp = TempDir::new().unwrap();
let temp = if cfg!(target_family = "unix") {
TempDir::new_in("/var/tmp").unwrap_or_else(|_| TempDir::new().unwrap())
} else {
TempDir::new().unwrap()
};
let source = temp.path().join("source");
let remote = temp.path().join("remote.git");
let cache = temp.path().join("cache");