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

Method Encode

plumbing/format/config/encoder.go:24–32  ·  view source on GitHub ↗

Encode writes the config in git config format to the stream of the encoder.

(cfg *Config)

Source from the content-addressed store, hash-verified

22
23// Encode writes the config in git config format to the stream of the encoder.
24func (e *Encoder) Encode(cfg *Config) error {
25 for _, s := range cfg.Sections {
26 if err := e.encodeSection(s); err != nil {
27 return err
28 }
29 }
30
31 return nil
32}
33
34func (e *Encoder) encodeSection(s *Section) error {
35 if len(s.Options) > 0 {

Callers 2

TestEncodeMethod · 0.95
TestDecodeMethod · 0.95

Calls 1

encodeSectionMethod · 0.95

Tested by 2

TestEncodeMethod · 0.76
TestDecodeMethod · 0.76