diff options
-rw-r--r-- | cmd_command.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd_command.go b/cmd_command.go index a6300b5..8c6a20a 100644 --- a/cmd_command.go +++ b/cmd_command.go @@ -38,6 +38,7 @@ type CmdCommit struct { OriginalOID string // optional Author *Ident Committer Ident + GPGSig string // optional Encoding string // optional Msg string From string @@ -59,6 +60,10 @@ func (c CmdCommit) fiCmdWrite(fiw fiWriter) error { ez.WriteLine("author", *c.Author) } ez.WriteLine("committer", c.Committer) + if c.GPGSig != "" { + ez.WriteLine("gpgsig") + ez.WriteData(c.GPGSig) + } if c.Encoding != "" { ez.WriteLine("encoding", c.Encoding) } @@ -105,6 +110,13 @@ func (CmdCommit) fiCmdRead(fir fiReader) (cmd Cmd, err error) { c.Committer, err = ParseIdent(trimLinePrefix(ez.ReadLine(), "committer ")) ez.Errcheck(err) + // ('gpgsig' LF data)? + if ez.PeekLine() == "gpgsig\n" { + ez.ReadLine() + c.GPGSig, err = parse_data(ez.ReadLine()) + ez.Errcheck(err) + } + // ('encoding' SP <encoding> LF)? if strings.HasPrefix(ez.PeekLine(), "encoding ") { c.Encoding = trimLinePrefix(ez.ReadLine(), "encoding ") |