Skip to content

Commit bffdd97

Browse files
timabellclaude
andcommitted
Use canonicalize for temp path in clone tests for macOS compatibility
On macOS, /var is a symlink to /private/var. Git clone stores the canonical path (/private/var/...) but temp.path() returns /var/... causing the string replacement to fail. Using canonicalize() resolves the symlink before stripping. Prompts: - "failed test run for macos https://github.com/timabell/gitopolis/actions/runs/19770651645/job/56653823929 ..." Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5c08d08 commit bffdd97

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/end_to_end_tests.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,7 +2603,9 @@ url = "source_zzz"
26032603
let remotes = String::from_utf8(remotes_output.stdout).expect("utf8 conversion failed");
26042604

26052605
// git clone converts relative local paths to absolute, so strip the temp path prefix
2606-
let temp_path_str = temp.path().to_str().unwrap();
2606+
// Use canonicalize to resolve symlinks (e.g., /var -> /private/var on macOS)
2607+
let temp_path_canonical = temp.path().canonicalize().unwrap();
2608+
let temp_path_str = temp_path_canonical.to_str().unwrap();
26072609
let remotes = remotes.replace(&format!("{}/", temp_path_str), "");
26082610

26092611
let expected_remotes = r#"aaa source_aaa (fetch)
@@ -2662,7 +2664,9 @@ url = "source_bbb"
26622664
let remotes = String::from_utf8(remotes_output.stdout).expect("utf8 conversion failed");
26632665

26642666
// git clone converts relative local paths to absolute, so strip the temp path prefix
2665-
let temp_path_str = temp.path().to_str().unwrap();
2667+
// Use canonicalize to resolve symlinks (e.g., /var -> /private/var on macOS)
2668+
let temp_path_canonical = temp.path().canonicalize().unwrap();
2669+
let temp_path_str = temp_path_canonical.to_str().unwrap();
26662670
let remotes = remotes.replace(&format!("{}/", temp_path_str), "");
26672671

26682672
// Should have aaa and bbb remotes, NOT origin

0 commit comments

Comments
 (0)