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

Function TestGetCommitTreeFiles_HEAD

vcs/git/git_tree_test.go:78–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestGetCommitTreeFiles_HEAD(t *testing.T) {
79 tmpDir := t.TempDir()
80 setupGitRepo(t, tmpDir)
81
82 createFile(t, tmpDir, "test.txt", "content")
83 gitAdd(t, tmpDir, "test.txt")
84 gitCommit(t, tmpDir, "Initial commit")
85
86 // Use HEAD reference
87 files, err := GetCommitTreeFiles(tmpDir, "HEAD")
88
89 require.NoError(t, err)
90 g := testhelpers.TextGoldie(t)
91 g.Assert(t, t.Name(), []byte(normalizeFilePaths(tmpDir, files)))
92}
93
94func TestGetCommitTreeFiles_OlderCommit(t *testing.T) {
95 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 8

TextGoldieFunction · 0.92
setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitFunction · 0.85
GetCommitTreeFilesFunction · 0.85
normalizeFilePathsFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected