diff --git a/product-source/hololake-platform/src-tauri/src/persona_remote_git.rs b/product-source/hololake-platform/src-tauri/src/persona_remote_git.rs index bc346208e..e6c43447c 100644 --- a/product-source/hololake-platform/src-tauri/src/persona_remote_git.rs +++ b/product-source/hololake-platform/src-tauri/src/persona_remote_git.rs @@ -389,9 +389,9 @@ fn read_remote_head(remote_url: &str, branch: &str) -> Result { 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");