(t *testing.T)
| 476 | } |
| 477 | |
| 478 | func TestGetCommitRangeLabel_WithHEAD(t *testing.T) { |
| 479 | tmpDir := t.TempDir() |
| 480 | setupGitRepo(t, tmpDir) |
| 481 | |
| 482 | createFile(t, tmpDir, "first.txt", "content") |
| 483 | gitAdd(t, tmpDir, "first.txt") |
| 484 | firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit") |
| 485 | |
| 486 | createFile(t, tmpDir, "second.txt", "content") |
| 487 | gitAdd(t, tmpDir, "second.txt") |
| 488 | gitCommit(t, tmpDir, "Second commit") |
| 489 | |
| 490 | label, err := GetCommitRangeLabel(tmpDir, firstCommit, "HEAD") |
| 491 | |
| 492 | require.NoError(t, err) |
| 493 | assert.Contains(t, label, "...") |
| 494 | } |
| 495 | |
| 496 | func TestGetCommitRangeLabel_InvalidFromCommit(t *testing.T) { |
| 497 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected