cli/pkg/cmd/pr/shared/git_cached_config_client.go
Kynan Ware 5de7a10080 Add godoc comments to exported symbols in pkg/cmd/pr
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-04 15:53:47 -07:00

20 lines
611 B
Go

package shared
import (
"context"
"github.com/cli/cli/v2/git"
)
var _ GitConfigClient = &CachedBranchConfigGitConfigClient{}
// CachedBranchConfigGitConfigClient wraps a GitConfigClient to return a pre-fetched BranchConfig instead of querying git.
type CachedBranchConfigGitConfigClient struct {
CachedBranchConfig git.BranchConfig
GitConfigClient
}
// ReadBranchConfig returns the cached BranchConfig, ignoring the branch name argument.
func (c CachedBranchConfigGitConfigClient) ReadBranchConfig(ctx context.Context, branchName string) (git.BranchConfig, error) {
return c.CachedBranchConfig, nil
}