aboutsummaryrefslogtreecommitdiff
path: root/builtin/log.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-10 17:41:51 -0400
committerJunio C Hamano <gitster@pobox.com>2014-06-13 12:08:17 -0700
commitbc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963 (patch)
tree1ba0e495b205f5ad222b426b848a7bae5cf8b265 /builtin/log.c
parentb66103c3baa593a39b8b0751213b9fce60e94de4 (diff)
downloadgit-bc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963.tar.gz
git-bc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963.tar.xz
use get_commit_buffer everywhere
Each of these sites assumes that commit->buffer is valid. Since they would segfault if this was not the case, they are likely to be correct in practice. However, we can future-proof them by using get_commit_buffer. And as a side effect, we abstract away the final bare uses of commit->buffer. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/log.c')
-rw-r--r--builtin/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 226f8f298..2c742606b 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -918,9 +918,12 @@ static void make_cover_letter(struct rev_info *rev, int use_stdout,
log_write_email_headers(rev, head, &pp.subject, &pp.after_subject,
&need_8bit_cte);
- for (i = 0; !need_8bit_cte && i < nr; i++)
- if (has_non_ascii(list[i]->buffer))
+ for (i = 0; !need_8bit_cte && i < nr; i++) {
+ const char *buf = get_commit_buffer(list[i]);
+ if (has_non_ascii(buf))
need_8bit_cte = 1;
+ unuse_commit_buffer(list[i], buf);
+ }
if (!branch_name)
branch_name = find_branch_name(rev);