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

Function TestClientFetchReportsMissingRef

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

Source from the content-addressed store, hash-verified

1223}
1224
1225func TestClientFetchReportsMissingRef(t *testing.T) {
1226 // Given a repository connected to an empty local remote
1227 repo := newTestRepo(t)
1228 repo.run(t, "remote", "add", "origin", newBareTestRepo(t).fileURL())
1229
1230 // When a missing ref is fetched
1231 err := repo.client.Fetch(t.Context(), "origin", "missing")
1232
1233 // Then Git reports a semantic command failure
1234 require.Error(t, err)
1235 var gitErr *GitError
1236 require.ErrorAs(t, err, &gitErr)
1237 assert.NotZero(t, gitErr.ExitCode)
1238}
1239
1240func TestClientFetchUsesAuthenticatedCommand(t *testing.T) {
1241 // Given a client that records the Git command

Callers

nothing calls this directly

Calls 6

newTestRepoFunction · 0.85
newBareTestRepoFunction · 0.85
fileURLMethod · 0.80
FetchMethod · 0.65
runMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected