summaryrefslogtreecommitdiff
path: root/merge-recursive.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-10 21:41:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-13 19:08:17 (GMT)
commitbc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963 (patch)
tree1ba0e495b205f5ad222b426b848a7bae5cf8b265 /merge-recursive.c
parentb66103c3baa593a39b8b0751213b9fce60e94de4 (diff)
downloadgit-bc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963.zip
git-bc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963.tar.gz
git-bc6b8fc1300ef79c4b4c3c2a79bb3c1e2e032963.tar.bz2
use get_commit_buffer everywhere
Each of these sites assumes that commit->buffer is valid. Since they would segfault if this was not the case, they are likely to be correct in practice. However, we can future-proof them by using get_commit_buffer. And as a side effect, we abstract away the final bare uses of commit->buffer. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'merge-recursive.c')
-rw-r--r--merge-recursive.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index fc2a68a..78908aa 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -190,9 +190,11 @@ static void output_commit_title(struct merge_options *o, struct commit *commit)
printf(_("(bad commit)\n"));
else {
const char *title;
- int len = find_commit_subject(commit->buffer, &title);
+ const char *msg = get_commit_buffer(commit);
+ int len = find_commit_subject(msg, &title);
if (len)
printf("%.*s\n", len, title);
+ unuse_commit_buffer(commit, msg);
}
}
}