bump go-git to fix invalid merge error

This commit is contained in:
Jesse Duffield 2020-10-06 21:00:36 +11:00
parent 6e076472b8
commit 0aed47737c
61 changed files with 1534 additions and 1927 deletions

View file

@ -78,13 +78,11 @@ func (b *Branch) marshal() *format.Subsection {
return b.raw
}
func (b *Branch) unmarshal(s *format.Subsection) error {
func (b *Branch) unmarshal(s *format.Subsection) {
b.raw = s
b.Name = b.raw.Name
b.Remote = b.raw.Options.Get(remoteSection)
b.Merge = plumbing.ReferenceName(b.raw.Options.Get(mergeKey))
b.Rebase = b.raw.Options.Get(rebaseKey)
return b.Validate()
}

View file

@ -256,8 +256,6 @@ func (c *Config) Unmarshal(b []byte) error {
}
unmarshalSubmodules(c.Raw, c.Submodules)
// ignore error
// Why ignore the error? It seems overly strict and for my use case none of the errors matter to me
c.unmarshalBranches()
return c.unmarshalRemotes()
@ -330,18 +328,15 @@ func unmarshalSubmodules(fc *format.Config, submodules map[string]*Submodule) {
}
}
func (c *Config) unmarshalBranches() error {
func (c *Config) unmarshalBranches() {
bs := c.Raw.Section(branchSection)
for _, sub := range bs.Subsections {
b := &Branch{}
if err := b.unmarshal(sub); err != nil {
// ignore error
}
b.unmarshal(sub)
c.Branches[b.Name] = b
}
return nil
}
// Marshal returns Config encoded as a git-config file.