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

Function TestClientCloneReportsMissingRepository

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

Source from the content-addressed store, hash-verified

1429}
1430
1431func TestClientCloneReportsMissingRepository(t *testing.T) {
1432 // Given a local repository URL that does not exist
1433 IsolateConfig(t)
1434 missingURL := fileURL(filepath.Join(t.TempDir(), "missing.git"))
1435 client := &Client{}
1436
1437 // When the repository is cloned
1438 target, err := client.Clone(t.Context(), missingURL, nil, WithRepoDir(t.TempDir()))
1439
1440 // Then Git reports a semantic command failure and no target
1441 require.Error(t, err)
1442 var gitErr *GitError
1443 require.ErrorAs(t, err, &gitErr)
1444 assert.NotZero(t, gitErr.ExitCode)
1445 assert.Empty(t, target)
1446}
1447
1448func TestClientCloneUsesHostScopedAuthenticatedCommand(t *testing.T) {
1449 // Given a client that records the Git command

Callers

nothing calls this directly

Calls 7

CloneMethod · 0.95
IsolateConfigFunction · 0.85
fileURLFunction · 0.85
WithRepoDirFunction · 0.85
JoinMethod · 0.80
EmptyMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected