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

Function TestGetRepositoryRoot_FromSubdirectory

vcs/git/git_test.go:77–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestGetRepositoryRoot_FromSubdirectory(t *testing.T) {
78 tmpDir := t.TempDir()
79 setupGitRepo(t, tmpDir)
80
81 // Create subdirectory
82 subDir := filepath.Join(tmpDir, "lib", "src")
83 err := os.MkdirAll(subDir, 0755)
84 require.NoError(t, err)
85
86 root, err := GetRepositoryRoot(subDir)
87
88 require.NoError(t, err)
89 resolvedTmp, _ := filepath.EvalSymlinks(tmpDir)
90 assert.Equal(t, resolvedTmp, root)
91}
92
93func TestGetRepositoryRoot_NotGitRepo(t *testing.T) {
94 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 2

setupGitRepoFunction · 0.85
GetRepositoryRootFunction · 0.85

Tested by

no test coverage detected