diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2021-02-01 17:49:52 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2021-02-01 18:16:11 -0700 |
commit | 08829058a1d436a2c2fb9cee88ef13a3d30ae3d4 (patch) | |
tree | c2eb8434f0c563ff80ab12b620a30d9dc7524afc /cmd_command.go | |
parent | 931930c001ffb8ac7c88414bcb0f1913e4681d63 (diff) |
Bring up to git.git commit 3edfcc65fdfc708c1c8f1d314885eecf9beb9b67
Diffstat (limited to 'cmd_command.go')
-rw-r--r-- | cmd_command.go | 9 |
1 files changed, 9 insertions, 0 deletions
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) |