Notes API: for_each_note(): Traverse the entire notes tree with a callback
[gitweb.git] / pretty.c
index 9001379a9dd93818e962ae73cdf85dc178804256..076b918b5234c14f3b6c5ee737a52ba678e714b5 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -775,8 +775,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,
                }
                return 0;       /* unknown %g placeholder */
        case 'N':
-               get_commit_notes(commit, sb, git_log_output_encoding ?
-                            git_log_output_encoding : git_commit_encoding, 0);
+               format_note(commit->object.sha1, sb, git_log_output_encoding ?
+                           git_log_output_encoding : git_commit_encoding, 0);
                return 1;
        }
 
@@ -1094,9 +1094,9 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit,
        if (fmt == CMIT_FMT_EMAIL && sb->len <= beginning_of_body)
                strbuf_addch(sb, '\n');
 
-       if (fmt != CMIT_FMT_ONELINE)
-               get_commit_notes(commit, sb, encoding,
-                                NOTES_SHOW_HEADER | NOTES_INDENT);
+       if (context->show_notes)
+               format_note(commit->object.sha1, sb, encoding,
+                           NOTES_SHOW_HEADER | NOTES_INDENT);
 
        free(reencoded);
 }