MCPcopy Create free account
hub / github.com/go-git/go-git / commitSignKey

Function commitSignKey

worktree_commit_test.go:543–560  ·  view source on GitHub ↗
(c *C, decrypt bool)

Source from the content-addressed store, hash-verified

541}
542
543func commitSignKey(c *C, decrypt bool) *openpgp.Entity {
544 s := strings.NewReader(armoredKeyRing)
545 es, err := openpgp.ReadArmoredKeyRing(s)
546 c.Assert(err, IsNil)
547
548 c.Assert(es, HasLen, 1)
549 c.Assert(es[0].Identities, HasLen, 1)
550 _, ok := es[0].Identities["foo bar <foo@foo.foo>"]
551 c.Assert(ok, Equals, true)
552
553 key := es[0]
554 if decrypt {
555 err = key.PrivateKey.Decrypt([]byte(keyPassphrase))
556 c.Assert(err, IsNil)
557 }
558
559 return key
560}
561
562const armoredKeyRing = `
563-----BEGIN PGP PRIVATE KEY BLOCK-----

Callers 5

TestCreateTagSignedMethod · 0.85
TestCommitSignMethod · 0.85
TestCommitSignBadKeyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected