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

Function getReadmePath

pkg/cmd/repo/view/http.go:65–74  ·  view source on GitHub ↗
(repo ghrepo.Interface, branch string)

Source from the content-addressed store, hash-verified

63}
64
65func getReadmePath(repo ghrepo.Interface, branch string) (safeurl.SafeURL, error) {
66 path, err := safeurl.JoinPath("repos", repo.RepoOwner(), repo.RepoName(), "readme")
67 if err != nil {
68 return nil, err
69 }
70 if branch != "" {
71 path.SetQuery("ref", branch)
72 }
73 return path, nil
74}

Callers 1

RepositoryReadmeFunction · 0.85

Calls 4

JoinPathFunction · 0.92
SetQueryMethod · 0.80
RepoOwnerMethod · 0.65
RepoNameMethod · 0.65

Tested by

no test coverage detected