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

Function TestClientCheckoutBranchReportsMissingBranch

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

Source from the content-addressed store, hash-verified

1015}
1016
1017func TestClientCheckoutBranchReportsMissingBranch(t *testing.T) {
1018 // Given a repository without the requested branch
1019 repo := newTestRepo(t)
1020
1021 // When the missing branch is checked out
1022 err := repo.client.CheckoutBranch(t.Context(), "missing")
1023
1024 // Then Git's checkout error is returned
1025 require.Error(t, err)
1026 var gitError *GitError
1027 require.ErrorAs(t, err, &gitError)
1028 assert.NotZero(t, gitError.ExitCode)
1029}
1030
1031func TestClientCheckoutNewBranchTracksRemoteBranch(t *testing.T) {
1032 // Given a repository with an origin feature tracking ref

Callers

nothing calls this directly

Calls 3

newTestRepoFunction · 0.85
CheckoutBranchMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected