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

Function TestClientSetRemoteResolutionAddsResolution

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

Source from the content-addressed store, hash-verified

229}
230
231func TestClientSetRemoteResolutionAddsResolution(t *testing.T) {
232 // Given a repository with an existing remote resolution
233 repo := newTestRepo(t)
234 repo.run(t, "config", "--add", "remote.origin.gh-resolved", "base")
235
236 // When another resolution is set
237 err := repo.client.SetRemoteResolution(t.Context(), "origin", "other")
238
239 // Then both resolutions are stored
240 require.NoError(t, err)
241 assert.Equal(t, "base\nother", repo.run(t, "config", "--get-all", "remote.origin.gh-resolved"))
242}
243
244func TestClientSetRemoteResolutionPropagatesGitError(t *testing.T) {
245 // Given a client whose repository directory does not exist

Callers

nothing calls this directly

Calls 4

newTestRepoFunction · 0.85
SetRemoteResolutionMethod · 0.80
EqualMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected