(t *testing.T)
| 23 | } |
| 24 | |
| 25 | func TestGetCommonDir_LinkedWorktree(t *testing.T) { |
| 26 | repo := t.TempDir() |
| 27 | setupGitRepo(t, repo) |
| 28 | seedInitialCommit(t, repo) |
| 29 | |
| 30 | wtParent := t.TempDir() |
| 31 | wt := filepath.Join(wtParent, "linked") |
| 32 | gitWorktreeAdd(t, repo, wt, "feat/linked") |
| 33 | |
| 34 | commonFromPrimary, err := GetCommonDir(repo) |
| 35 | require.NoError(t, err) |
| 36 | commonFromLinked, err := GetCommonDir(wt) |
| 37 | require.NoError(t, err) |
| 38 | |
| 39 | assert.Equal(t, resolveSymlinks(commonFromPrimary), resolveSymlinks(commonFromLinked), |
| 40 | "common dir must be identical for primary and linked worktrees") |
| 41 | } |
| 42 | |
| 43 | func TestGetGitDir_PrimaryEqualsCommon(t *testing.T) { |
| 44 | repo := t.TempDir() |
nothing calls this directly
no test coverage detected