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

Function TestClientUnsetRemoteResolutionRemovesResolution

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

Source from the content-addressed store, hash-verified

1146}
1147
1148func TestClientUnsetRemoteResolutionRemovesResolution(t *testing.T) {
1149 // Given a repository with a resolved remote
1150 repo := newTestRepo(t)
1151 repo.run(t, "remote", "add", "origin", "https://github.com/cli/cli.git")
1152 repo.run(t, "config", "remote.origin.gh-resolved", "base")
1153
1154 // When the remote resolution is unset
1155 err := repo.client.UnsetRemoteResolution(t.Context(), "origin")
1156
1157 // Then the remote no longer has a resolution
1158 require.NoError(t, err)
1159 remotes, err := repo.client.Remotes(t.Context())
1160 require.NoError(t, err)
1161 require.Len(t, remotes, 1)
1162 assert.Empty(t, remotes[0].Resolved)
1163}
1164
1165func TestClientUnsetRemoteResolutionPropagatesGitError(t *testing.T) {
1166 // Given a client whose repository directory does not exist

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected