MCPcopy
hub / github.com/github/github-mcp-server / URLFromOpts

Method URLFromOpts

pkg/raw/raw.go:44–52  ·  view source on GitHub ↗
(opts *ContentOpts, owner, repo, path string)

Source from the content-addressed store, hash-verified

42}
43
44func (c *Client) URLFromOpts(opts *ContentOpts, owner, repo, path string) string {
45 if opts == nil {
46 opts = &ContentOpts{}
47 }
48 if opts.SHA != "" {
49 return c.commitURL(owner, repo, opts.SHA, path)
50 }
51 return c.refURL(owner, repo, opts.Ref, path)
52}
53
54// BlobURL returns the URL for a blob in the raw content API.
55func (c *Client) commitURL(owner, repo, sha, path string) string {

Callers 3

GetRawContentMethod · 0.95
TestGetRawContentFunction · 0.95
TestUrlFromOptsFunction · 0.95

Calls 2

commitURLMethod · 0.95
refURLMethod · 0.95

Tested by 2

TestGetRawContentFunction · 0.76
TestUrlFromOptsFunction · 0.76