Commit 62eb2f8316902f81f5d55f684f3994672a1073bf

Edward Thomson 2021-09-21T10:59:49

email: don't clear buffer in append function `git_email__append_from_diff` is meant to - well, append from a diff. Clearing the buffer, by definition, is not appending. Stop doing that.

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/email.c b/src/email.c
index 8957d9a..df63b6e 100644
--- a/src/email.c
+++ b/src/email.c
@@ -217,7 +217,6 @@ int git_email__append_from_diff(
 		memcpy(&opts, given_opts, sizeof(git_email_create_options));
 
 	git_buf_sanitize(out);
-	git_buf_clear(out);
 
 	if ((error = append_header(out, patch_idx, patch_count, commit_id, summary, author, &opts)) == 0 &&
 	    (error = append_body(out, body)) == 0 &&