MCPcopy Index your code
hub / github.com/go-git/go-git / commitSignKey

Function commitSignKey

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

Source from the content-addressed store, hash-verified

706}
707
708func commitSignKey(c *C, decrypt bool) *openpgp.Entity {
709 s := strings.NewReader(armoredKeyRing)
710 es, err := openpgp.ReadArmoredKeyRing(s)
711 c.Assert(err, IsNil)
712
713 c.Assert(es, HasLen, 1)
714 c.Assert(es[0].Identities, HasLen, 1)
715 _, ok := es[0].Identities["foo bar <foo@foo.foo>"]
716 c.Assert(ok, Equals, true)
717
718 key := es[0]
719 if decrypt {
720 err = key.PrivateKey.Decrypt([]byte(keyPassphrase))
721 c.Assert(err, IsNil)
722 }
723
724 return key
725}
726
727const armoredKeyRing = `
728-----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

Used in the wild real call sites across dependent graphs

searching dependent graphs…