summaryrefslogtreecommitdiff
path: root/src/libgit2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2023-04-08 21:32:45 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2023-04-10 14:21:16 +0100
commita47bc4eacbe9c1d4e8e546fba7abcd22fca537b1 (patch)
tree11158ae74a3fd1c96f8f251f0177d9018e478ee5 /src/libgit2
parent4875d998de40d929ab6af8e26a76c9570d84121c (diff)
downloadlibgit2-a47bc4eacbe9c1d4e8e546fba7abcd22fca537b1.tar.gz
email: support sha256
Diffstat (limited to 'src/libgit2')
-rw-r--r--src/libgit2/email.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libgit2/email.c b/src/libgit2/email.c
index 0a75021c8..8a10a12b7 100644
--- a/src/libgit2/email.c
+++ b/src/libgit2/email.c
@@ -130,11 +130,12 @@ static int append_header(
const git_signature *author,
git_email_create_options *opts)
{
- char id[GIT_OID_SHA1_HEXSIZE];
+ char id[GIT_OID_MAX_HEXSIZE + 1];
int error;
- if ((error = git_oid_fmt(id, commit_id)) < 0 ||
- (error = git_str_printf(out, "From %.*s %s\n", GIT_OID_SHA1_HEXSIZE, id, EMAIL_TIMESTAMP)) < 0 ||
+ git_oid_tostr(id, GIT_OID_MAX_HEXSIZE + 1, commit_id);
+
+ if ((error = git_str_printf(out, "From %s %s\n", id, EMAIL_TIMESTAMP)) < 0 ||
(error = git_str_printf(out, "From: %s <%s>\n", author->name, author->email)) < 0 ||
(error = append_date(out, &author->when)) < 0 ||
(error = append_subject(out, patch_idx, patch_count, summary, opts)) < 0)