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

Function TestClientRemotesToleratesMissingResolutionConfig

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

Source from the content-addressed store, hash-verified

146}
147
148func TestClientRemotesToleratesMissingResolutionConfig(t *testing.T) {
149 // Given a remote without resolution metadata
150 repo := newTestRepo(t)
151 repo.run(t, "remote", "add", "origin", "git@example.com:monalisa/origin.git")
152
153 // When the remotes are listed
154 remotes, err := repo.client.Remotes(t.Context())
155
156 // Then Git's no-matching-config status is treated as an empty resolution
157 require.NoError(t, err)
158 require.Len(t, remotes, 1)
159 assert.Equal(t, "origin", remotes[0].Name)
160 assert.Empty(t, remotes[0].Resolved)
161}
162
163func TestParseRemotes(t *testing.T) {
164 // Given remote output with fetch-only, push-only, paired, and mixed URL forms

Callers

nothing calls this directly

Calls 6

newTestRepoFunction · 0.85
EqualMethod · 0.80
EmptyMethod · 0.80
RemotesMethod · 0.65
LenMethod · 0.65
runMethod · 0.45

Tested by

no test coverage detected