summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 17:49:52 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2021-02-01 18:16:11 -0700
commit08829058a1d436a2c2fb9cee88ef13a3d30ae3d4 (patch)
treec2eb8434f0c563ff80ab12b620a30d9dc7524afc
parent931930c001ffb8ac7c88414bcb0f1913e4681d63 (diff)
Bring up to git.git commit 3edfcc65fdfc708c1c8f1d314885eecf9beb9b67
-rw-r--r--cmd.go2
-rw-r--r--cmd_command.go9
2 files changed, 10 insertions, 1 deletions
diff --git a/cmd.go b/cmd.go
index 7582b47..7b7e122 100644
--- a/cmd.go
+++ b/cmd.go
@@ -27,7 +27,7 @@
// A program can read commands from a frontend by wrapping the
// appropriate io.Reader with a Frontend object.
//
-// This is up-to-date with full syntax supported by git v2.22.0.
+// This is up-to-date with full syntax supported by git v2.23.0.
package libfastimport
type fiReader interface {
diff --git a/cmd_command.go b/cmd_command.go
index e68a3b1..a326524 100644
--- a/cmd_command.go
+++ b/cmd_command.go
@@ -38,6 +38,7 @@ type CmdCommit struct {
OriginalOID string // optional
Author *Ident
Committer Ident
+ Encoding string // optional
Msg string
From string
Merge []string
@@ -58,6 +59,9 @@ func (c CmdCommit) fiCmdWrite(fiw fiWriter) error {
ez.WriteLine("author", *c.Author)
}
ez.WriteLine("committer", c.Committer)
+ if c.Encoding != "" {
+ ez.WriteLine("encoding", c.Encoding)
+ }
ez.WriteData(c.Msg)
if c.From != "" {
ez.WriteLine("from", c.From)
@@ -101,6 +105,11 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) {
c.Committer, err = ParseIdent(trimLinePrefix(ez.ReadLine(), "committer "))
ez.Errcheck(err)
+ // ('encoding' SP <encoding> LF)?
+ if strings.HasPrefix(ez.PeekLine(), "encoding ") {
+ c.Encoding = trimLinePrefix(ez.ReadLine(), "encoding ")
+ }
+
// data
c.Msg, err = parse_data(ez.ReadLine())
ez.Errcheck(err)