summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:29:49 -0500
committerLuke Shumaker <lukeshu@lukeshu.com>2017-11-16 15:29:49 -0500
commitc16e4c36d4f5f5f9d6d21f4644b9c38b61159c47 (patch)
treeaea862a0f2357153b92d71c18fba511dbc221079
parent56b8f0793f036727aeb0a45968c6f69e260775e6 (diff)
commands: commit: separate 'from' and 'merge'
-rw-r--r--commands.go15
1 files 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 {