summaryrefslogtreecommitdiffstats
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-31 18:18:23 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-31 18:55:28 -0800
commite90068a9046ccaf0bed82fd180b4748edbd5659a (patch)
treed1395f34dc5e00533e00caf27b10fd8c7569ab77 /commit.c
parentDo not merge random set of refs out of wildcarded refs (diff)
downloadgit-e90068a9046ccaf0bed82fd180b4748edbd5659a.tar.gz
git-e90068a9046ccaf0bed82fd180b4748edbd5659a.zip
i18n: do not leak 'encoding' header even when we cheat the conversion.
We special case the case where encoding recorded in the commit and the output encoding are the same and do not call iconv(). But we should drop 'encoding' header for this case as well for consistency. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index afdf27eece..544e42629e 100644
--- a/commit.c
+++ b/commit.c
@@ -679,11 +679,13 @@ static char *logmsg_reencode(const struct commit *commit)
else if (!*output_encoding)
return NULL;
encoding = get_header(commit, "encoding");
- if (!encoding || !strcmp(encoding, output_encoding)) {
- free(encoding);
+ if (!encoding)
return NULL;
- }
- out = reencode_string(commit->buffer, output_encoding, encoding);
+ if (!strcmp(encoding, output_encoding))
+ out = strdup(commit->buffer);
+ else
+ out = reencode_string(commit->buffer,
+ output_encoding, encoding);
if (out)
out = replace_encoding_header(out, output_encoding);
: fix quoting of redirect for some versions of bashCharles Bailey1-1/+1 2015-12-04git-check-ref-format.txt: typo, s/avoids/avoid/Nguyễn Thái Ngọc Duy1-1/+1 2015-12-04document submodule sync --recursiveStefan Beller1-1/+4 2015-12-04Prepare for 2.6.4Junio C Hamano2-1/+49 2015-12-04RelNotes update for 2.7Junio C Hamano1-0/+51 2015-12-01verify_pack: do not ignore return value of verification functionDavid Turner1-1/+1 2015-12-01Make error message after failing commit_lock_file() less confusingSZEDER Gábor4-5/+8 2015-11-28wt-status: correct and simplify check for detached HEADRené Scharfe1-5/+4 2015-11-28ident.c: add support for IPv6Elia Pinto1-4/+27