diff options
-rw-r--r-- | notes.c | 6 | ||||
-rw-r--r-- | notes.h | 5 | ||||
-rw-r--r-- | revision.c | 2 |
3 files changed, 12 insertions, 1 deletions
@@ -1039,6 +1039,12 @@ struct notes_tree **load_notes_trees(struct string_list *refs, int flags) return trees; } +void init_display_notes(struct display_notes_opt *opt) +{ + memset(opt, 0, sizeof(*opt)); + opt->use_default_notes = -1; +} + void load_display_notes(struct display_notes_opt *opt) { char *display_ref_env; @@ -261,6 +261,11 @@ struct display_notes_opt { }; /* + * Initialize a display_notes_opt to its default value. + */ +void init_display_notes(struct display_notes_opt *opt); + +/* * Load the notes machinery for displaying several notes trees. * * If 'opt' is not NULL, then it specifies additional settings for the diff --git a/revision.c b/revision.c index d4aaf0ef25..24ad974590 100644 --- a/revision.c +++ b/revision.c @@ -1637,7 +1637,7 @@ void repo_init_revisions(struct repository *r, revs->diffopt.prefix_length = strlen(prefix); } - revs->notes_opt.use_default_notes = -1; + init_display_notes(&revs->notes_opt); } static void add_pending_commit_list(struct rev_info *revs, |