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

Function TestClientUpdateRemoteURLUpdatesConfiguredRemote

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

Source from the content-addressed store, hash-verified

200}
201
202func TestClientUpdateRemoteURLUpdatesConfiguredRemote(t *testing.T) {
203 // Given a repository with a local remote
204 repo := newTestRepo(t)
205 original := newBareTestRepo(t)
206 replacement := newBareTestRepo(t)
207 repo.run(t, "remote", "add", "test", original.fileURL())
208
209 // When the remote URL is updated
210 err := repo.client.UpdateRemoteURL(t.Context(), "test", replacement.fileURL())
211
212 // Then Git stores the replacement URL
213 require.NoError(t, err)
214 assert.Equal(t, replacement.fileURL(), repo.run(t, "remote", "get-url", "test"))
215}
216
217func TestClientUpdateRemoteURLReportsMissingRemote(t *testing.T) {
218 // Given a repository without the named remote

Callers

nothing calls this directly

Calls 6

newTestRepoFunction · 0.85
newBareTestRepoFunction · 0.85
fileURLMethod · 0.80
UpdateRemoteURLMethod · 0.80
EqualMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected