(t *testing.T, entity *openpgp.Entity, commit *Commit)
| 311 | } |
| 312 | |
| 313 | func 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 |
| 332 | func setupRepoForRebase(repo *Repository, masterCommit, branchName string, commitOpts commitOptions) error { |
no test coverage detected
searching dependent graphs…