mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 00:02:23 +00:00
`repo_home_resolves_worktree_layouts` feeds `repo_home` the --git-dir and --git-common-dir this file believes git prints. That tests the model, and the model is the part that can be wrong: the only reason `repo_home` exists is that those two disagree inside a linked worktree, and what they look like when they do is git's to decide. So: `git worktree add` for real, then probe from inside it. The root has to be the worktree the pane sits in and the home the repository it was added from — swap them and every path the SCM panel offers belongs to the wrong checkout. tty7 is developed in worktrees, so this is the layout the panel runs in most days. They agree, and `assert_ne!(home, root)` keeps the test honest: equal there would mean the branch under test was never taken. Both paths are canonicalized because the temp directory is reached through a symlink on macOS. Checked that the run reaches its assertions rather than taking one of its two early returns — root ends in /linked, home in /main, branch "side".