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

Function TestGetCommitRangeLabel_WithHEAD

vcs/git/git_test.go:478–494  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

476}
477
478func 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
496func TestGetCommitRangeLabel_InvalidFromCommit(t *testing.T) {
497 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 6

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitAndGetSHAFunction · 0.85
gitCommitFunction · 0.85
GetCommitRangeLabelFunction · 0.85

Tested by

no test coverage detected