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

Function TestClientSetRemoteResolutionPropagatesGitError

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

Source from the content-addressed store, hash-verified

242}
243
244func TestClientSetRemoteResolutionPropagatesGitError(t *testing.T) {
245 // Given a client whose repository directory does not exist
246 client := Client{RepoDir: filepath.Join(t.TempDir(), "missing")}
247
248 // When a remote resolution is set
249 err := client.SetRemoteResolution(t.Context(), "origin", "base")
250
251 // Then the Git error is returned
252 require.Error(t, err)
253 var gitErr *GitError
254 require.ErrorAs(t, err, &gitErr)
255 assert.NotZero(t, gitErr.ExitCode)
256}
257
258func TestClientCurrentBranchReturnsCurrentBranch(t *testing.T) {
259 // Given a repository checked out on a branch containing non-breaking spaces

Callers

nothing calls this directly

Calls 3

SetRemoteResolutionMethod · 0.95
JoinMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected