]> asedeno.scripts.mit.edu Git - git.git/blobdiff - log-tree.c
Merge branch 'js/rebase-detached'
[git.git] / log-tree.c
index 62edd344558049f05c33888de9d2fc2a854b51e9..a34beb0b027eaec59fa75d1fa18324a8f24eb13d 100644 (file)
@@ -15,7 +15,7 @@ static void show_parents(struct commit *commit, int abbrev)
        }
 }
 
-static void show_decorations(struct commit *commit)
+void show_decorations(struct commit *commit)
 {
        const char *prefix;
        struct name_decoration *decoration;
@@ -125,6 +125,18 @@ static unsigned int digits_in_number(unsigned int number)
        return result;
 }
 
+static int has_non_ascii(const char *s)
+{
+       int ch;
+       if (!s)
+               return 0;
+       while ((ch = *s++) != '\0') {
+               if (non_ascii(ch))
+                       return 1;
+       }
+       return 0;
+}
+
 void show_log(struct rev_info *opt, const char *sep)
 {
        struct strbuf msgbuf;
@@ -273,7 +285,8 @@ void show_log(struct rev_info *opt, const char *sep)
         */
        strbuf_init(&msgbuf, 0);
        pretty_print_commit(opt->commit_format, commit, &msgbuf,
-                                 abbrev, subject, extra_headers, opt->date_mode);
+                           abbrev, subject, extra_headers, opt->date_mode,
+                           has_non_ascii(opt->add_signoff));
 
        if (opt->add_signoff)
                append_signoff(&msgbuf, opt->add_signoff);