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

Function TestGetCommitTreeFiles_OlderCommit

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

Source from the content-addressed store, hash-verified

92}
93
94func TestGetCommitTreeFiles_OlderCommit(t *testing.T) {
95 tmpDir := t.TempDir()
96 setupGitRepo(t, tmpDir)
97
98 // First commit with one file
99 createFile(t, tmpDir, "first.txt", "first content")
100 gitAdd(t, tmpDir, "first.txt")
101 firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit")
102
103 // Second commit adds another file
104 createFile(t, tmpDir, "second.txt", "second content")
105 gitAdd(t, tmpDir, "second.txt")
106 gitCommit(t, tmpDir, "Second commit")
107
108 // Get tree from first commit - should only have first file
109 files, err := GetCommitTreeFiles(tmpDir, firstCommit)
110
111 require.NoError(t, err)
112 g := testhelpers.TextGoldie(t)
113 g.Assert(t, t.Name(), []byte(normalizeFilePaths(tmpDir, files)))
114}
115
116func TestGetCommitTreeFiles_AfterFileDeleted(t *testing.T) {
117 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 9

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

Tested by

no test coverage detected