[PATCH 2/2] pretty.c: use original commit message if reencoding fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
---
 pretty.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/pretty.c b/pretty.c
index 375ff7b..230fe1c 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1103,8 +1103,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);
 	}
 
-- 
1.7.3.1.256.g2539c.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]