Esempio n. 1
0
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
	}
}
Esempio n. 2
0
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++
	}
}
Esempio n. 3
0
func (c *ConfigStorage) unmarshalCore(cfg *config.Config, ini *gitconfig.Config) {
	s := ini.Section(coreSection)
	if s.Options.Get(bareKey) == "true" {
		cfg.Core.IsBare = true
	}
}
Esempio n. 4
0
func (c *ConfigStorage) marshalCore(cfg *config.Config, ini *gitconfig.Config) {
	s := ini.Section(coreSection)
	s.AddOption(bareKey, fmt.Sprintf("%t", cfg.Core.IsBare))
}