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

Function TestGetCommitTreeFiles_SingleFile

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

Source from the content-addressed store, hash-verified

12)
13
14func TestGetCommitTreeFiles_SingleFile(t *testing.T) {
15 tmpDir := t.TempDir()
16 setupGitRepo(t, tmpDir)
17
18 // Create and commit a file
19 createFile(t, tmpDir, "test.txt", "content")
20 gitAdd(t, tmpDir, "test.txt")
21 commitID := gitCommitAndGetSHA(t, tmpDir, "Initial commit")
22
23 // Get all files in the commit tree
24 files, err := GetCommitTreeFiles(tmpDir, commitID)
25
26 require.NoError(t, err)
27 g := testhelpers.TextGoldie(t)
28 g.Assert(t, t.Name(), []byte(normalizeFilePaths(tmpDir, files)))
29}
30
31func TestGetCommitTreeFiles_MultipleFiles(t *testing.T) {
32 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected