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>
This commit is contained in:
parent
9cd7a92b97
commit
1d5bd615c0
5
pretty.c
5
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user