From c16e4c36d4f5f5f9d6d21f4644b9c38b61159c47 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 16 Nov 2017 15:29:49 -0500 Subject: commands: commit: separate 'from' and 'merge' --- commands.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/commands.go b/commands.go index d017f7f..378b6b9 100644 --- a/commands.go +++ b/commands.go @@ -16,7 +16,8 @@ type CmdCommit struct { Author *textproto.UserTime Committer textproto.UserTime Msg []byte - Parents []string + From string + Merge []string Tree []FileAction } @@ -32,13 +33,11 @@ func (c CmdCommit) fiWriteCmd(fiw *textproto.FIWriter) error { } ez.WriteLine("committer", c.Committer) ez.WriteData(c.Msg) - if len(c.Parents) > 0 { - ez.WriteLine("from", c.Parents[0]) - if len(c.Parents) > 1 { - for _, parent := range c.Parents[1:] { - ez.WriteLine("merge", parent) - } - } + if c.From != "" { + ez.WriteLine("from", c.From) + } + for _, merge := range c.Merge { + ez.WriteLine("merge", merge) } if ez.err != nil { -- cgit v1.2.3