MCPcopy Create free account
hub / github.com/cli/cli / TestClientCommitsReportsNoCommitsBetweenRefs

Function TestClientCommitsReportsNoCommitsBetweenRefs

git/client_test.go:415–426  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

413}
414
415func TestClientCommitsReportsNoCommitsBetweenRefs(t *testing.T) {
416 // Given two refs that identify the same commit
417 repo := newTestRepo(t)
418 repo.run(t, "commit", "--quiet", "--allow-empty", "-m", "initial commit")
419
420 // When commits between the refs are requested
421 commits, err := repo.client.Commits(t.Context(), "trunk", "trunk")
422
423 // Then the empty comparison is reported
424 require.EqualError(t, err, "could not find any commits between trunk and trunk")
425 assert.Nil(t, commits)
426}
427
428func TestClientCommitsExcludesBaseSideCommits(t *testing.T) {
429 // Given divergent branches with patch-equivalent commits and one unique feature commit

Callers

nothing calls this directly

Calls 3

newTestRepoFunction · 0.85
CommitsMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected