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

Function TestGetCommitRangeFiles_ModifiedFile

vcs/git/git_diff_test.go:600–619  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

598}
599
600func TestGetCommitRangeFiles_ModifiedFile(t *testing.T) {
601 tmpDir := t.TempDir()
602 setupGitRepo(t, tmpDir)
603
604 // Create first commit
605 file := createFile(t, tmpDir, "test.txt", "initial content")
606 gitAdd(t, tmpDir, "test.txt")
607 firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit")
608
609 // Modify and commit again
610 modifyFile(t, file)
611 gitAdd(t, tmpDir, "test.txt")
612 secondCommit := gitCommitAndGetSHA(t, tmpDir, "Second commit")
613
614 files, err := GetCommitRangeFiles(tmpDir, firstCommit, secondCommit)
615
616 require.NoError(t, err)
617 g := testhelpers.TextGoldie(t)
618 g.Assert(t, t.Name(), []byte(normalizeFilePaths(tmpDir, files)))
619}
620
621func TestGetCommitRangeFiles_ExcludesDeletedFiles(t *testing.T) {
622 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
modifyFileFunction · 0.85
GetCommitRangeFilesFunction · 0.85
normalizeFilePathsFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected