| 67 | PyDoc_STRVAR(Commit_gpg_signature__doc__, "A tuple with the GPG signature and the signed payload."); |
| 68 | |
| 69 | PyObject * |
| 70 | Commit_gpg_signature__get__(Commit *self) |
| 71 | { |
| 72 | git_buf gpg_signature = { NULL }, signed_data = { NULL }; |
| 73 | PyObject *py_gpg_signature, *py_signed_data; |
| 74 | |
| 75 | const git_oid *oid = Object__id((Object*)self); |
| 76 | int err = git_commit_extract_signature( |
| 77 | &gpg_signature, &signed_data, self->repo->repo, (git_oid*) oid, NULL |
| 78 | ); |
| 79 | |
| 80 | if (err != GIT_OK){ |
| 81 | git_buf_dispose(&gpg_signature); |
| 82 | git_buf_dispose(&signed_data); |
| 83 | |
| 84 | if (err == GIT_ENOTFOUND){ |
| 85 | return Py_BuildValue("OO", Py_None, Py_None); |
| 86 | } |
| 87 | |
| 88 | return Error_set(err); |
| 89 | } |
| 90 | |
| 91 | py_gpg_signature = PyBytes_FromString(gpg_signature.ptr); |
| 92 | py_signed_data = PyBytes_FromString(signed_data.ptr); |
| 93 | git_buf_dispose(&gpg_signature); |
| 94 | git_buf_dispose(&signed_data); |
| 95 | |
| 96 | return Py_BuildValue("NN", py_gpg_signature, py_signed_data); |
| 97 | } |
| 98 | |
| 99 | |
| 100 | PyDoc_STRVAR(Commit_message_trailers__doc__, |
nothing calls this directly
no test coverage detected
searching dependent graphs…