Tests for GetCommitRangeFiles
(t *testing.T)
| 550 | // Tests for GetCommitRangeFiles |
| 551 | |
| 552 | func 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 | |
| 573 | func TestGetCommitRangeFiles_MultipleCommits(t *testing.T) { |
| 574 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected