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

Function gpgSign

tests/objectverify/main_test.go:300–311  ·  view source on GitHub ↗

gpgSign produces an ASCII-armored detached signature over payload using the test key.

(t *testing.T, payload []byte)

Source from the content-addressed store, hash-verified

298// gpgSign produces an ASCII-armored detached signature over payload using
299// the test key.
300func gpgSign(t *testing.T, payload []byte) string {
301 t.Helper()
302 cmd := exec.Command("gpg",
303 "--batch", "--pinentry-mode", "loopback", "--passphrase", "",
304 "--armor", "--detach-sign", "--local-user", gpg.keyID)
305 cmd.Stdin = bytes.NewReader(payload)
306 var stderr bytes.Buffer
307 cmd.Stderr = &stderr
308 out, err := cmd.Output()
309 require.NoErrorf(t, err, "gpg --detach-sign: %s", stderr.String())
310 return string(out)
311}
312
313func initRepo(t *testing.T) string {
314 t.Helper()

Callers 2

TestTagVerifyAlignmentFunction · 0.85

Calls 2

CommandMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…