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

Function TestClientPushReportsMissingRemote

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

Source from the content-addressed store, hash-verified

1339}
1340
1341func TestClientPushReportsMissingRemote(t *testing.T) {
1342 // Given a repository with a local trunk commit but no remote
1343 repo := newTestRepo(t)
1344 repo.commit(t, "local commit")
1345
1346 // When trunk is pushed to a missing remote
1347 err := repo.client.Push(t.Context(), "missing", "trunk")
1348
1349 // Then Git reports a semantic command failure
1350 require.Error(t, err)
1351 var gitErr *GitError
1352 require.ErrorAs(t, err, &gitErr)
1353 assert.NotZero(t, gitErr.ExitCode)
1354}
1355
1356func TestClientPushUsesAuthenticatedUpstreamCommand(t *testing.T) {
1357 // Given a client that records the Git command

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
commitMethod · 0.80
PushMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected