MCPcopy Create free account
hub / github.com/go-git/go-git / Decode

Method Decode

plumbing/format/config/decoder.go:21–37  ·  view source on GitHub ↗

Decode reads the whole config from its input and stores it in the value pointed to by config.

(config *Config)

Source from the content-addressed store, hash-verified

19// Decode reads the whole config from its input and stores it in the
20// value pointed to by config.
21func (d *Decoder) Decode(config *Config) error {
22 cb := func(s string, ss string, k string, v string, bv bool) error {
23 if ss == "" && k == "" {
24 config.Section(s)
25 return nil
26 }
27
28 if ss != "" && k == "" {
29 config.Section(s).Subsection(ss)
30 return nil
31 }
32
33 config.AddOption(s, ss, k, v)
34 return nil
35 }
36 return gcfg.ReadWithCallback(d, cb)
37}

Callers 3

TestDecodeMethod · 0.95
decodeFailsFunction · 0.95
FuzzDecoderFunction · 0.95

Calls 3

SectionMethod · 0.80
SubsectionMethod · 0.80
AddOptionMethod · 0.45

Tested by 3

TestDecodeMethod · 0.76
decodeFailsFunction · 0.76
FuzzDecoderFunction · 0.76