Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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);