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

Function TestClientUpdateRemoteURLReportsMissingRemote

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

Source from the content-addressed store, hash-verified

215}
216
217func TestClientUpdateRemoteURLReportsMissingRemote(t *testing.T) {
218 // Given a repository without the named remote
219 repo := newTestRepo(t)
220
221 // When the remote URL is updated
222 err := repo.client.UpdateRemoteURL(t.Context(), "missing", newBareTestRepo(t).fileURL())
223
224 // Then Git reports a semantic command failure
225 require.Error(t, err)
226 var gitErr *GitError
227 require.ErrorAs(t, err, &gitErr)
228 assert.NotZero(t, gitErr.ExitCode)
229}
230
231func TestClientSetRemoteResolutionAddsResolution(t *testing.T) {
232 // Given a repository with an existing remote resolution

Callers

nothing calls this directly

Calls 5

newTestRepoFunction · 0.85
newBareTestRepoFunction · 0.85
UpdateRemoteURLMethod · 0.80
fileURLMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected