MCPcopy
hub / github.com/go-git/go-git / Unmarshal

Method Unmarshal

config/modules.go:49–60  ·  view source on GitHub ↗

Unmarshal parses a git-config file and stores it.

(b []byte)

Source from the content-addressed store, hash-verified

47
48// Unmarshal parses a git-config file and stores it.
49func (m *Modules) Unmarshal(b []byte) error {
50 r := bytes.NewBuffer(b)
51 d := format.NewDecoder(r)
52
53 m.raw = format.New()
54 if err := d.Decode(m.raw); err != nil {
55 return err
56 }
57
58 unmarshalSubmodules(m.raw, m.Submodules)
59 return nil
60}
61
62// Marshal returns Modules encoded as a git-config file.
63func (m *Modules) Marshal() ([]byte, error) {

Callers 3

readGitmodulesFileMethod · 0.95
TestUnmarshalMethod · 0.95
TestUnmarshalMarshalMethod · 0.95

Calls 2

DecodeMethod · 0.95
unmarshalSubmodulesFunction · 0.85

Tested by 2

TestUnmarshalMethod · 0.76
TestUnmarshalMarshalMethod · 0.76