X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pretty.c;h=f5983f8baa98b69338707b4220e64012ef4e5d11;hb=749086fa090d81c10ebf16b1abfd138c3fa0232e;hp=e5328dab5b2978d90d20f47ed799782e7b2fb63b;hpb=d1926f63ec93e84dba1a54c5de898fb517d9ca59;p=git.git diff --git a/pretty.c b/pretty.c index e5328dab5..f5983f8ba 100644 --- a/pretty.c +++ b/pretty.c @@ -86,6 +86,18 @@ int non_ascii(int ch) return !isascii(ch) || ch == '\033'; } +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; +} + static int is_rfc2047_special(char ch) { return (non_ascii(ch) || (ch == '=') || (ch == '?') || (ch == '_')); @@ -571,7 +583,7 @@ static void format_decoration(struct strbuf *sb, const struct commit *commit) struct name_decoration *d; const char *prefix = " ("; - load_ref_decorations(); + load_ref_decorations(DECORATE_SHORT_REFS); d = lookup_decoration(&name_decoration, &commit->object); while (d) { strbuf_addstr(sb, prefix);