Skip to content

Commit

Permalink
pretty.c: use original commit message if reencoding fails
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Oct 24, 2011
1 parent 9cd7a92 commit 1d5bd61
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1d5bd61

Please sign in to comment.