Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit a97934d

Browse files
peffgitster
authored andcommitted
use get_cached_commit_buffer where appropriate
Some call sites check commit->buffer to see whether we have a cached buffer, and if so, do some work with it. In the long run we may want to switch these code paths to make their decision on a different boolean flag (because checking the cache may get a little more expensive in the future). But for now, we can easily support them by converting the calls to use get_cached_commit_buffer. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 152ff1c commit a97934d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void show_commit(struct commit *commit, void *data)
106106
else
107107
putchar('\n');
108108

109-
if (revs->verbose_header && commit->buffer) {
109+
if (revs->verbose_header && get_cached_commit_buffer(commit)) {
110110
struct strbuf buf = STRBUF_INIT;
111111
struct pretty_print_context ctx = {0};
112112
ctx.abbrev = revs->abbrev;

log-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ void show_log(struct rev_info *opt)
588588
show_mergetag(opt, commit);
589589
}
590590

591-
if (!commit->buffer)
591+
if (!get_cached_commit_buffer(commit))
592592
return;
593593

594594
if (opt->show_notes) {

object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
197197
if (commit) {
198198
if (parse_commit_buffer(commit, buffer, size))
199199
return NULL;
200-
if (!commit->buffer) {
200+
if (!get_cached_commit_buffer(commit)) {
201201
set_commit_buffer(commit, buffer);
202202
*eaten_p = 1;
203203
}

0 commit comments

Comments
 (0)