Пример #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
	}
}
Пример #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++
	}
}
Пример #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
	}
}
Пример #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))
}