MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / TestGetCommonDir_LinkedWorktree

Function TestGetCommonDir_LinkedWorktree

vcs/git/git_worktree_test.go:25–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23}
24
25func 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
43func TestGetGitDir_PrimaryEqualsCommon(t *testing.T) {
44 repo := t.TempDir()

Callers

nothing calls this directly

Calls 5

setupGitRepoFunction · 0.85
seedInitialCommitFunction · 0.85
gitWorktreeAddFunction · 0.85
GetCommonDirFunction · 0.85
resolveSymlinksFunction · 0.70

Tested by

no test coverage detected