diff options
author | Filip Navara <filip.navara@gmail.com> | 2019-04-26 10:07:59 +0200 |
---|---|---|
committer | Filip Navara <filip.navara@gmail.com> | 2019-04-26 10:07:59 +0200 |
commit | 14c17dc6881fccf851c8bdffab15774faa3bce8b (patch) | |
tree | e4e567231fee000bf6a6424577c60ce907431a18 /plumbing/object/commit.go | |
parent | 34cb7a3aededd002881504dd729527628e923fc6 (diff) | |
parent | ca5d7bb1a790303d2ca245cb6225850bcf5d12a6 (diff) | |
download | go-git-14c17dc6881fccf851c8bdffab15774faa3bce8b.tar.gz |
Merge branch 'master' into commitgraph-obj
Diffstat (limited to 'plumbing/object/commit.go')
-rw-r--r-- | plumbing/object/commit.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go index 511242d..6b50934 100644 --- a/plumbing/object/commit.go +++ b/plumbing/object/commit.go @@ -235,6 +235,11 @@ func (b *Commit) Encode(o plumbing.EncodedObject) error { return b.encode(o, true) } +// EncodeWithoutSignature export a Commit into a plumbing.EncodedObject without the signature (correspond to the payload of the PGP signature). +func (b *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error { + return b.encode(o, false) +} + func (b *Commit) encode(o plumbing.EncodedObject, includeSig bool) (err error) { o.SetType(plumbing.CommitObject) w, err := o.Writer() @@ -349,7 +354,7 @@ func (c *Commit) Verify(armoredKeyRing string) (*openpgp.Entity, error) { encoded := &plumbing.MemoryObject{} // Encode commit components, excluding signature and get a reader object. - if err := c.encode(encoded, false); err != nil { + if err := c.EncodeWithoutSignature(encoded); err != nil { return nil, err } er, err := encoded.Reader() |