summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorMichael J Gruber <git@drmicha.warpmail.net>2014-06-23 07:05:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-23 22:50:30 (GMT)
commit71c214c840782a67801fc8dbf5fe8a4f4fc62d01 (patch)
tree22b7db0f0ddac955e11d4a6c8a43ce4e9517b36e /commit.c
parent01e57b5d91b0c9f2ac93708c5c2cbcd4731ddd34 (diff)
downloadgit-71c214c840782a67801fc8dbf5fe8a4f4fc62d01.zip
git-71c214c840782a67801fc8dbf5fe8a4f4fc62d01.tar.gz
git-71c214c840782a67801fc8dbf5fe8a4f4fc62d01.tar.bz2
gpg-interface: provide access to the payload
In contrast to tag signatures, commit signatures are put into the header, that is between the other header parts and commit messages. Provide access to the commit content sans the signature, which is the payload that is actually signed. Commit signature verification does the parsing anyways, and callers may wish to act on or display the commit object sans the signature. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/commit.c b/commit.c
index f479331..e9686b2 100644
--- a/commit.c
+++ b/commit.c
@@ -1219,6 +1219,7 @@ void check_commit_signature(const struct commit* commit, struct signature_check
&gpg_output, &gpg_status);
if (status && !gpg_output.len)
goto out;
+ sigc->payload = strbuf_detach(&payload, NULL);
sigc->gpg_output = strbuf_detach(&gpg_output, NULL);
sigc->gpg_status = strbuf_detach(&gpg_status, NULL);
parse_gpg_output(sigc);