summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-05-19 05:28:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 05:07:20 (GMT)
commit87be252333bac84d425973627266dfa20511224d (patch)
tree86e6ab8cf5b0c81da90b2b443a81fb601d1bc669 /log-tree.c
parent3cc0287b394bf802af68d4fdb8c18e16318df907 (diff)
downloadgit-87be252333bac84d425973627266dfa20511224d.zip
git-87be252333bac84d425973627266dfa20511224d.tar.gz
git-87be252333bac84d425973627266dfa20511224d.tar.bz2
revision.c: use commit-slab for show_source
Instead of relying on commit->util to store the source string, let the user provide a commit-slab to store the source strings in. It's done so that commit->util can be removed. See more explanation in the commit that removes commit->util. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/log-tree.c b/log-tree.c
index d1c0bed..0b41ee3 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -295,8 +295,12 @@ void show_decorations(struct rev_info *opt, struct commit *commit)
{
struct strbuf sb = STRBUF_INIT;
- if (opt->show_source && commit->util)
- fprintf(opt->diffopt.file, "\t%s", (char *) commit->util);
+ if (opt->sources) {
+ char **slot = revision_sources_peek(opt->sources, commit);
+
+ if (slot && *slot)
+ fprintf(opt->diffopt.file, "\t%s", *slot);
+ }
if (!opt->show_decorations)
return;
format_decorations(&sb, commit, opt->diffopt.use_color);