MCPcopy
hub / github.com/git-lfs/git-lfs / Get

Method Get

config/url_config.go:28–39  ·  view source on GitHub ↗

Get retrieves a `http.{url}.{key}` for the given key and urls, following the rules in https://git-scm.com/docs/git-config#Documentation/git-config.txt-httplturlgt. The value for `http.{key}` is returned as a fallback if no config keys are set for the given urls.

(prefix, rawurl, key string)

Source from the content-addressed store, hash-verified

26// The value for `http.{key}` is returned as a fallback if no config keys are
27// set for the given urls.
28func (c *URLConfig) Get(prefix, rawurl, key string) (string, bool) {
29 if c == nil {
30 return "", false
31 }
32
33 key = strings.ToLower(key)
34 prefix = strings.ToLower(prefix)
35 if v := c.getAll(prefix, rawurl, key); len(v) > 0 {
36 return v[len(v)-1], true
37 }
38 return c.git.Get(strings.Join([]string{prefix, key}, "."))
39}
40
41func (c *URLConfig) GetAll(prefix, rawurl, key string) []string {
42 if c == nil {

Callers 7

getVerifyStateForFunction · 0.95
SSHTransferMethod · 0.95
findStandaloneTransferFunction · 0.95
sshResolveWithRetriesMethod · 0.95
BoolMethod · 0.95
TestURLConfigFunction · 0.95

Calls 2

getAllMethod · 0.95
GetMethod · 0.65

Tested by 1

TestURLConfigFunction · 0.76