aboutsummaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2011-10-23 22:51:35 +1100
committerJunio C Hamano <gitster@pobox.com>2011-10-23 21:34:23 -0700
commit1d5bd615c0d8dadfa9dee0511b3ba3feaf838877 (patch)
tree51e42d2e8059aafcfd8b10e918fb18e62a6956b7 /pretty.c
parent9cd7a92b97d0b4321c19e8952a3a9b1874e3abb5 (diff)
downloadgit-1d5bd615c0d8dadfa9dee0511b3ba3feaf838877.tar.gz
git-1d5bd615c0d8dadfa9dee0511b3ba3feaf838877.tar.xz
pretty.c: use original commit message if reencoding fails
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c5
1 files changed, 4 insertions, 1 deletions
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);
}