MCPcopy Index your code
hub / github.com/jetify-com/devbox / url

Method url

internal/plugin/github.go:134–145  ·  view source on GitHub ↗
(subpath string)

Source from the content-addressed store, hash-verified

132}
133
134func (p *githubPlugin) url(subpath string) (string, error) {
135 // Github redirects "master" to "main" in new repos. They don't do the reverse
136 // so setting master here is better.
137 return url.JoinPath(
138 "https://raw.githubusercontent.com/",
139 p.ref.Owner,
140 p.ref.Repo,
141 cmp.Or(p.ref.Rev, p.ref.Ref, "master"),
142 p.ref.Dir,
143 subpath,
144 )
145}
146
147func (p *githubPlugin) request(contentURL string) (*http.Request, error) {
148 req, err := http.NewRequest(http.MethodGet, contentURL, nil)

Callers 3

FileContentMethod · 0.95
TestGithubPluginAuthFunction · 0.95
TestNewGithubPluginFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestGithubPluginAuthFunction · 0.76
TestNewGithubPluginFunction · 0.64