func (c *ConfigStorage) unmarshalRemotes(cfg *config.Config, ini *gitconfig.Config) { s := ini.Section(remoteSection) for _, sub := range s.Subsections { r := c.unmarshalRemote(sub) cfg.Remotes[r.Name] = r } }
func (c *ConfigStorage) marshalRemotes(cfg *config.Config, ini *gitconfig.Config) { s := ini.Section(remoteSection) s.Subsections = make(gitconfig.Subsections, len(cfg.Remotes)) var i int for _, r := range cfg.Remotes { s.Subsections[i] = c.marshalRemote(r) i++ } }
func (c *ConfigStorage) unmarshalCore(cfg *config.Config, ini *gitconfig.Config) { s := ini.Section(coreSection) if s.Options.Get(bareKey) == "true" { cfg.Core.IsBare = true } }
func (c *ConfigStorage) marshalCore(cfg *config.Config, ini *gitconfig.Config) { s := ini.Section(coreSection) s.AddOption(bareKey, fmt.Sprintf("%t", cfg.Core.IsBare)) }