From 004ceae6370cd0054248ffb3b09c411791fde9ec Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 29 Apr 2021 19:30:56 -0600 Subject: signed commits v1 --- cmd_command.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 LF)? if strings.HasPrefix(ez.PeekLine(), "encoding ") { c.Encoding = trimLinePrefix(ez.ReadLine(), "encoding ") -- cgit v1.2.3-54-g00ecf