Skip to content

Commit d576398

Browse files
authored
fix(tests): canonicalize the temp repo path in the integration helper (#200)
setup_integration_repo took its path straight from mktemp -d, which on macOS returns /var/folders/... while /var is a symlink to /private/var. git canonicalizes when it registers a worktree, so the preRemove hook received the /private/var spelling and 'cmd_clean --merged uses nested registered worktree path' compared it against the /var one. This is the test's expectation being wrong rather than a product bug: passing a /var path to 'git worktree add' makes git itself register the resolved one. Resolving the path once in the helper fixes it for every integration test. Linux is unaffected, since mktemp -d returns /tmp with no symlink, which is why CI stayed green. Local suite now passes 561/561, previously 560/561.
1 parent f4df634 commit d576398

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- The integration test helper now canonicalizes its temporary repository path. On macOS `mktemp -d` returns a `/var` path while git records the resolved `/private/var` one, so `cmd_clean --merged uses nested registered worktree path` compared two spellings of the same directory and failed locally while passing in CI.
12+
913
## [2.11.1] - 2026-09-14
1014

1115
### Changed

‎tests/test_helper.bash‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ export -f cfg_default cfg_get_all
2323
# Set up a disposable git repo for integration tests
2424
# Sets: TEST_REPO, TEST_WORKTREES_DIR
2525
setup_integration_repo() {
26-
TEST_REPO=$(mktemp -d)
26+
# Canonicalize: on macOS mktemp -d returns a /var path while git records the
27+
# resolved /private/var one, so uncanonicalized paths never compare equal.
28+
TEST_REPO=$(cd -P "$(mktemp -d)" && pwd)
2729
TEST_WORKTREES_DIR="${TEST_REPO}-worktrees"
2830
git -C "$TEST_REPO" init --quiet
2931
git -C "$TEST_REPO" config user.name "Test User"

0 commit comments

Comments
 (0)