summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-11-14 00:13:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 08:22:40 (GMT)
commitf54fbf5eefb9740a318344fe400f54f047cc4bf1 (patch)
treec24d8e186e763729b503571c26b0247601debb23 /pretty.c
parent424510ed193fdc49cacc832d8795677d0cc54461 (diff)
downloadgit-f54fbf5eefb9740a318344fe400f54f047cc4bf1.zip
git-f54fbf5eefb9740a318344fe400f54f047cc4bf1.tar.gz
git-f54fbf5eefb9740a318344fe400f54f047cc4bf1.tar.bz2
pretty: prepare format_commit_message to handle arbitrary repositories
Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/pretty.c b/pretty.c
index b359b68..3240495 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1508,9 +1508,10 @@ void userformat_find_requirements(const char *fmt, struct userformat_want *w)
strbuf_release(&dummy);
}
-void format_commit_message(const struct commit *commit,
- const char *format, struct strbuf *sb,
- const struct pretty_print_context *pretty_ctx)
+void repo_format_commit_message(struct repository *r,
+ const struct commit *commit,
+ const char *format, struct strbuf *sb,
+ const struct pretty_print_context *pretty_ctx)
{
struct format_commit_context context;
const char *output_enc = pretty_ctx->output_encoding;
@@ -1524,9 +1525,9 @@ void format_commit_message(const struct commit *commit,
* convert a commit message to UTF-8 first
* as far as 'format_commit_item' assumes it in UTF-8
*/
- context.message = logmsg_reencode(commit,
- &context.commit_encoding,
- utf8);
+ context.message = repo_logmsg_reencode(r, commit,
+ &context.commit_encoding,
+ utf8);
strbuf_expand(sb, format, format_commit_item, &context);
rewrap_message_tail(sb, &context, 0, 0, 0);
@@ -1550,7 +1551,7 @@ void format_commit_message(const struct commit *commit,
}
free(context.commit_encoding);
- unuse_commit_buffer(commit, context.message);
+ repo_unuse_commit_buffer(r, commit, context.message);
}
static void pp_header(struct pretty_print_context *pp,