Skip to content

Commit

Permalink
commit re-encoding: fix confusion between no and default conversion.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 30, 2006
1 parent 1ed4813 commit 4b46e22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,8 @@ static char *logmsg_reencode(const struct commit *commit)
: git_commit_encoding);

if (!output_encoding)
output_encoding = "utf-8";
else if (!*output_encoding)
return NULL;
encoding = get_header(commit, "encoding");
if (!encoding || !strcmp(encoding, output_encoding)) {
Expand Down

0 comments on commit 4b46e22

Please sign in to comment.