summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2021-04-29 19:30:56 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2021-04-29 19:30:56 -0600
commit004ceae6370cd0054248ffb3b09c411791fde9ec (patch)
tree1c26d14451c7de6b79147538ffde308e02654f14
parent00160f6afe221862fdfdfab381979c8cd31daeb7 (diff)
signed commits v1
-rw-r--r--cmd_command.go12
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 ")