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

Function TestClientReadBranchConfigPropagatesGitError

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

Source from the content-addressed store, hash-verified

555}
556
557func TestClientReadBranchConfigPropagatesGitError(t *testing.T) {
558 // Given a client whose repository directory no longer exists
559 repo := newTestRepo(t)
560 require.NoError(t, os.RemoveAll(repo.dir))
561
562 // When branch configuration is read
563 branchConfig, err := repo.client.ReadBranchConfig(t.Context(), "trunk")
564
565 // Then the repository error is preserved
566 require.Error(t, err)
567 var gitError *GitError
568 require.ErrorAs(t, err, &gitError)
569 assert.Equal(t, 128, gitError.ExitCode)
570 assert.Empty(t, branchConfig)
571}
572
573func TestParseBranchConfig(t *testing.T) {
574 tests := []struct {

Callers

nothing calls this directly

Calls 5

newTestRepoFunction · 0.85
EqualMethod · 0.80
EmptyMethod · 0.80
ReadBranchConfigMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected