MCPcopy
hub / github.com/go-git/go-git / EncodeWithoutSignature

Method EncodeWithoutSignature

plumbing/object/commit.go:307–312  ·  view source on GitHub ↗

EncodeWithoutSignature exports a Commit into a plumbing.EncodedObject without any signature headers, producing the payload that PGP/GPG signatures are computed over. Behaviour depends on how the Commit was created: - For Commits populated by Decode whose exported fields still match the source obje

(o plumbing.EncodedObject)

Source from the content-addressed store, hash-verified

305// object and comparing exported fields; if any differ, the in-memory
306// representation prevails.
307func (c *Commit) EncodeWithoutSignature(o plumbing.EncodedObject) error {
308 if c.matchesSource() {
309 return stripObjectSignatures(o, c.src, plumbing.CommitObject)
310 }
311 return c.encode(o, false)
312}
313
314// matchesSource reports whether c.src is set and re-decoding it produces a
315// Commit whose payload-affecting exported fields are identical to those of

Callers 1

VerifyMethod · 0.95

Calls 3

matchesSourceMethod · 0.95
encodeMethod · 0.95
stripObjectSignaturesFunction · 0.85

Tested by

no test coverage detected