@matheusbsbs / matheus-bagliano / commits / 4b46e22d48
Fork 0

commit re-encoding: fix confusion between no and default conversion.

Telling the git-log family not to do any character conversion is done with --encoding=none, which sets log_output_encoding to an empty string. However, logmsg_reencode() confused this with log_output_encoding and commit_encoding set to NULL. The latter means we should use the default encoding (i.e. utf-8). Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 30, 2006 at 02:18 UTC 4b46e22d48271d1a220133a925dc5009048eb577
1 file changed +2
commit.c
+2
@@ -633,6 +633,8 @@ static char *logmsg_reencode(const struct commit *commit)
633 : git_commit_encoding);
634
635 if (!output_encoding)
636 + output_encoding = "utf-8";
637 + else if (!*output_encoding)
638 return NULL;
639 encoding = get_header(commit, "encoding");
640 if (!encoding || !strcmp(encoding, output_encoding)) {