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

Function TestGetCommitRangeFiles_Success

vcs/git/git_diff_test.go:552–571  ·  view source on GitHub ↗

Tests for GetCommitRangeFiles

(t *testing.T)

Source from the content-addressed store, hash-verified

550// Tests for GetCommitRangeFiles
551
552func TestGetCommitRangeFiles_Success(t *testing.T) {
553 tmpDir := t.TempDir()
554 setupGitRepo(t, tmpDir)
555
556 // Create first commit
557 createFile(t, tmpDir, "first.txt", "content")
558 gitAdd(t, tmpDir, "first.txt")
559 firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit")
560
561 // Create second commit with new file
562 createFile(t, tmpDir, "second.txt", "content")
563 gitAdd(t, tmpDir, "second.txt")
564 secondCommit := gitCommitAndGetSHA(t, tmpDir, "Second commit")
565
566 files, err := GetCommitRangeFiles(tmpDir, firstCommit, secondCommit)
567
568 require.NoError(t, err)
569 g := testhelpers.TextGoldie(t)
570 g.Assert(t, t.Name(), []byte(normalizeFilePaths(tmpDir, files)))
571}
572
573func TestGetCommitRangeFiles_MultipleCommits(t *testing.T) {
574 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
GetCommitRangeFilesFunction · 0.85
normalizeFilePathsFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected