summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-10 21:41:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-13 19:08:17 (GMT)
commitb66103c3baa593a39b8b0751213b9fce60e94de4 (patch)
tree3bdd4603011427fe37e0d9a90d3a910860e22238 /commit.h
parentba41c1c93fd9109eae954f75a8cb8e32c3e29530 (diff)
downloadgit-b66103c3baa593a39b8b0751213b9fce60e94de4.zip
git-b66103c3baa593a39b8b0751213b9fce60e94de4.tar.gz
git-b66103c3baa593a39b8b0751213b9fce60e94de4.tar.bz2
convert logmsg_reencode to get_commit_buffer
Like the callsites in the previous commit, logmsg_reencode already falls back to read_sha1_file when necessary. However, I split its conversion out into its own commit because it's a bit more complex. We return either: 1. The original commit->buffer 2. A newly allocated buffer from read_sha1_file 3. A reencoded buffer (based on either 1 or 2 above). while trying to do as few extra reads/allocations as possible. Callers currently free the result with logmsg_free, but we can simplify this by pointing them straight to unuse_commit_buffer. This is a slight layering violation, in that we may be passing a buffer from (3). However, since the end result is to free() anything except (1), which is unlikely to change, and because this makes the interface much simpler, it's a reasonable bending of the rules. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/commit.h b/commit.h
index 259c0ae..5ce5ce7 100644
--- a/commit.h
+++ b/commit.h
@@ -156,7 +156,6 @@ struct rev_info; /* in revision.h, it circularly uses enum cmit_fmt */
extern const char *logmsg_reencode(const struct commit *commit,
char **commit_encoding,
const char *output_encoding);
-extern void logmsg_free(const char *msg, const struct commit *commit);
extern void get_commit_format(const char *arg, struct rev_info *);
extern const char *format_subject(struct strbuf *sb, const char *msg,
const char *line_separator);