MCPcopy Create free account
hub / github.com/libgit2/git2go / checkCommitSigned

Function checkCommitSigned

rebase_test.go:313–329  ·  view source on GitHub ↗
(t *testing.T, entity *openpgp.Entity, commit *Commit)

Source from the content-addressed store, hash-verified

311}
312
313func checkCommitSigned(t *testing.T, entity *openpgp.Entity, commit *Commit) error {
314 t.Helper()
315
316 signature, signedData, err := commit.ExtractSignature()
317 if err != nil {
318 t.Logf("No signature on commit\n%s", commit.ContentToSign())
319 return err
320 }
321
322 _, err = openpgp.CheckArmoredDetachedSignature(openpgp.EntityList{entity}, strings.NewReader(signedData), bytes.NewBufferString(signature))
323 if err != nil {
324 t.Logf("Commit is not signed correctly\n%s", commit.ContentToSign())
325 return err
326 }
327
328 return nil
329}
330
331// Utils
332func setupRepoForRebase(repo *Repository, masterCommit, branchName string, commitOpts commitOptions) error {

Callers 1

checkAllCommitsSignedFunction · 0.85

Calls 2

ExtractSignatureMethod · 0.80
ContentToSignMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…