Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index 9402b6e61..67fab0763 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1659,6 +1659,7 @@ int git_diff_format_email__append_header_tobuf(
const git_oid *id,
const git_signature *author,
const char *summary,
+ const char *body,
size_t patch_no,
size_t total_patches,
bool exclude_patchno_marker)
@@ -1698,6 +1699,13 @@ int git_diff_format_email__append_header_tobuf(
error = git_buf_printf(out, "%s\n\n", summary);
+ if (body) {
+ git_buf_puts(out, body);
+
+ if (out->ptr[out->size - 1] != '\n')
+ git_buf_putc(out, '\n');
+ }
+
return error;
}
@@ -1775,7 +1783,7 @@ int git_diff_format_email(
error = git_diff_format_email__append_header_tobuf(out,
opts->id, opts->author, summary == NULL ? opts->summary : summary,
- opts->patch_no, opts->total_patches, ignore_marker);
+ opts->body, opts->patch_no, opts->total_patches, ignore_marker);
if (error < 0)
goto on_error;
@@ -1818,6 +1826,7 @@ int git_diff_commit_as_email(
opts.total_patches = total_patches;
opts.id = git_commit_id(commit);
opts.summary = git_commit_summary(commit);
+ opts.body = git_commit_body(commit);
opts.author = git_commit_author(commit);
if ((error = git_diff__commit(&diff, repo, commit, diff_opts)) < 0)