revision.c: use commit-slab for show_source
[git/git.git] / log-tree.c
index d1c0bed..0b41ee3 100644 (file)
@@ -295,8 +295,12 @@ void show_decorations(struct rev_info *opt, struct commit *commit)
 {
        struct strbuf sb = STRBUF_INIT;
 
 {
        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);
        if (!opt->show_decorations)
                return;
        format_decorations(&sb, commit, opt->diffopt.use_color);