|
|
|
@ -595,14 +595,15 @@ static char *replace_encoding_header(char *buf, const char *encoding)
@@ -595,14 +595,15 @@ static char *replace_encoding_header(char *buf, const char *encoding)
|
|
|
|
|
return strbuf_detach(&tmp, NULL); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const char *logmsg_reencode(const struct commit *commit, |
|
|
|
|
char **commit_encoding, |
|
|
|
|
const char *output_encoding) |
|
|
|
|
const char *repo_logmsg_reencode(struct repository *r, |
|
|
|
|
const struct commit *commit, |
|
|
|
|
char **commit_encoding, |
|
|
|
|
const char *output_encoding) |
|
|
|
|
{ |
|
|
|
|
static const char *utf8 = "UTF-8"; |
|
|
|
|
const char *use_encoding; |
|
|
|
|
char *encoding; |
|
|
|
|
const char *msg = get_commit_buffer(commit, NULL); |
|
|
|
|
const char *msg = repo_get_commit_buffer(r, commit, NULL); |
|
|
|
|
char *out; |
|
|
|
|
|
|
|
|
|
if (!output_encoding || !*output_encoding) { |
|
|
|
@ -630,7 +631,7 @@ const char *logmsg_reencode(const struct commit *commit,
@@ -630,7 +631,7 @@ const char *logmsg_reencode(const struct commit *commit,
|
|
|
|
|
* the cached copy from get_commit_buffer, we need to duplicate it |
|
|
|
|
* to avoid munging the cached copy. |
|
|
|
|
*/ |
|
|
|
|
if (msg == get_cached_commit_buffer(the_repository, commit, NULL)) |
|
|
|
|
if (msg == get_cached_commit_buffer(r, commit, NULL)) |
|
|
|
|
out = xstrdup(msg); |
|
|
|
|
else |
|
|
|
|
out = (char *)msg; |
|
|
|
@ -644,7 +645,7 @@ const char *logmsg_reencode(const struct commit *commit,
@@ -644,7 +645,7 @@ const char *logmsg_reencode(const struct commit *commit,
|
|
|
|
|
*/ |
|
|
|
|
out = reencode_string(msg, output_encoding, use_encoding); |
|
|
|
|
if (out) |
|
|
|
|
unuse_commit_buffer(commit, msg); |
|
|
|
|
repo_unuse_commit_buffer(r, commit, msg); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|