summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-16 10:07:12 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-16 10:07:12 -0700
commit09e13ad5b0f0689418a723289dca7b3c72d538c4 (patch)
tree370f325d1897f553d57e8e615b976e7668990616 /pretty.c
parentb0e2c999af7aa69a0b8d9677107d4c09938e528a (diff)
parent7d509878b845a2a895cc880b833a016a06199981 (diff)
downloadgit-09e13ad5b0f0689418a723289dca7b3c72d538c4.tar.gz
Merge branch 'as/pretty-truncate'
* as/pretty-truncate: pretty.c: format string with truncate respects logOutputEncoding t4205, t6006: add tests that fail with i18n.logOutputEncoding set t4205 (log-pretty-format): use `tformat` rather than `format` t4041, t4205, t6006, t7102: don't hardcode tested encoding value t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index e1e2cad36d..4f512876ce 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1506,13 +1506,18 @@ void format_commit_message(const struct commit *commit,
context.commit = commit;
context.pretty_ctx = pretty_ctx;
context.wrap_start = sb->len;
+ /*
+ * convert a commit message to UTF-8 first
+ * as far as 'format_commit_item' assumes it in UTF-8
+ */
context.message = logmsg_reencode(commit,
&context.commit_encoding,
- output_enc);
+ utf8);
strbuf_expand(sb, format, format_commit_item, &context);
rewrap_message_tail(sb, &context, 0, 0, 0);
+ /* then convert a commit message to an actual output encoding */
if (output_enc) {
if (same_encoding(utf8, output_enc))
output_enc = NULL;