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

Function TestGetCommitTreeFiles_InvalidCommit

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

Source from the content-addressed store, hash-verified

161}
162
163func TestGetCommitTreeFiles_InvalidCommit(t *testing.T) {
164 tmpDir := t.TempDir()
165 setupGitRepo(t, tmpDir)
166
167 createFile(t, tmpDir, "test.txt", "content")
168 gitAdd(t, tmpDir, "test.txt")
169 gitCommit(t, tmpDir, "Initial commit")
170
171 _, err := GetCommitTreeFiles(tmpDir, "invalid-sha-that-does-not-exist")
172
173 assert.Error(t, err)
174 assert.Contains(t, err.Error(), "invalid commit reference")
175}
176
177func TestGetCommitTreeFiles_NotGitRepo(t *testing.T) {
178 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 5

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitFunction · 0.85
GetCommitTreeFilesFunction · 0.85

Tested by

no test coverage detected