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

Function TestClientLastCommit

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

Source from the content-addressed store, hash-verified

495}
496
497func TestClientLastCommit(t *testing.T) {
498 // Given a repository fixture with two commits
499 IsolateConfig(t)
500 client := Client{RepoDir: "./fixtures/simple.git"}
501
502 // When its last commit is requested
503 commit, err := client.LastCommit(t.Context())
504
505 // Then the commit identity and title are returned
506 require.NoError(t, err)
507 assert.Equal(t, "6f1a2405cace1633d89a79c74c65f22fe78f9659", commit.Sha)
508 assert.Equal(t, "Second commit", commit.Title)
509}
510
511func TestClientCommitBody(t *testing.T) {
512 // Given a repository fixture with a commit body

Callers

nothing calls this directly

Calls 3

LastCommitMethod · 0.95
IsolateConfigFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected