Merge branch 'as/pretty-truncate'
authorJunio C Hamano <gitster@pobox.com>
Mon, 16 Jun 2014 17:07:12 +0000 (10:07 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jun 2014 17:07:12 +0000 (10:07 -0700)
* 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

1  2 
pretty.c
diff --combined pretty.c
index e1e2cad36d6d2d2773f05c6e69b0013ed8d01240,c9cf67ea7c85012ef7c57d0fe92cf62089afaf49..4f512876ceb20f538256bac30dd98288abe2d682
+++ b/pretty.c
@@@ -393,8 -393,8 +393,8 @@@ static void add_rfc2047(struct strbuf *
        strbuf_addstr(sb, "?=");
  }
  
 -static const char *show_ident_date(const struct ident_split *ident,
 -                                 enum date_mode mode)
 +const char *show_ident_date(const struct ident_split *ident,
 +                          enum date_mode mode)
  {
        unsigned long date = 0;
        long tz = 0;
@@@ -1506,13 -1506,18 +1506,18 @@@ void format_commit_message(const struc
        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;