From 1d5bd615c0d8dadfa9dee0511b3ba3feaf838877 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sun, 23 Oct 2011 22:51:35 +1100 Subject: [PATCH] pretty.c: use original commit message if reencoding fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- pretty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); } -- 2.30.2