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

Function TestIsAncestor_SameCommit

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

Source from the content-addressed store, hash-verified

377}
378
379func TestIsAncestor_SameCommit(t *testing.T) {
380 tmpDir := t.TempDir()
381 setupGitRepo(t, tmpDir)
382
383 createFile(t, tmpDir, "test.txt", "content")
384 gitAdd(t, tmpDir, "test.txt")
385 commit := gitCommitAndGetSHA(t, tmpDir, "Commit")
386
387 // A commit is its own ancestor
388 result, err := isAncestor(tmpDir, commit, commit)
389
390 require.NoError(t, err)
391 assert.True(t, result)
392}
393
394// Tests for NormalizeCommitRange
395

Callers

nothing calls this directly

Calls 5

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitAndGetSHAFunction · 0.85
isAncestorFunction · 0.85

Tested by

no test coverage detected