From: Nguyễn Thái Ngọc Duy Date: Sun, 23 Oct 2011 11:51:35 +0000 (+1100) Subject: pretty.c: use original commit message if reencoding fails X-Git-Tag: v1.7.8-rc1~14^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1d5bd615c0d8dadfa9dee0511b3ba3feaf838877;p=git.git pretty.c: use original commit message if reencoding fails Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/pretty.c b/pretty.c index 34d668cc3..f00933f2e 100644 --- a/pretty.c +++ b/pretty.c @@ -1022,8 +1022,11 @@ void format_commit_message(const struct commit *commit, context.message = commit->buffer; if (output_enc) { char *enc = get_header(commit, "encoding"); - if (strcmp(enc ? enc : utf8, output_enc)) + if (strcmp(enc ? enc : utf8, output_enc)) { context.message = logmsg_reencode(commit, output_enc); + if (!context.message) + context.message = commit->buffer; + } free(enc); }