summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-12-07 14:10:56 -0800
committerJunio C Hamano <gitster@pobox.com>2012-12-07 14:10:56 -0800
commitfff26a68053022a2cbc39142c7c6f6d016837058 (patch)
tree1ad5a3cd1a135213b3694f11fdcb52bcddec51b9 /pretty.c
parent6a402843c2bc0a72fb70c8795aee523d7f1582d3 (diff)
parent0e18bcd5e937b9e5857892e7f5c80c3c5b1da5d4 (diff)
downloadgit-fff26a68053022a2cbc39142c7c6f6d016837058.tar.gz
Merge branch 'jc/same-encoding' into maint
Various codepaths checked if two encoding names are the same using ad-hoc code and some of them ended up asking iconv() to convert between "utf8" and "UTF-8". The former is not a valid way to spell the encoding name, but often people use it by mistake, and we equated them in some but not all codepaths. Introduce a new helper function to make these codepaths consistent. * jc/same-encoding: reencode_string(): introduce and use same_encoding()
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pretty.c b/pretty.c
index 413e7587b6..dba682828c 100644
--- a/pretty.c
+++ b/pretty.c
@@ -571,7 +571,7 @@ char *logmsg_reencode(const struct commit *commit,
return NULL;
encoding = get_header(commit, "encoding");
use_encoding = encoding ? encoding : utf8;
- if (!strcmp(use_encoding, output_encoding))
+ if (same_encoding(use_encoding, output_encoding))
if (encoding) /* we'll strip encoding header later */
out = xstrdup(commit->buffer);
else