(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func 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 | |
| 116 | func TestGetCommitTreeFiles_AfterFileDeleted(t *testing.T) { |
| 117 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected