| 1108 | } |
| 1109 | |
| 1110 | void load_display_notes(struct display_notes_opt *opt) |
| 1111 | { |
| 1112 | char *display_ref_env; |
| 1113 | int load_config_refs = 0; |
| 1114 | display_notes_refs.strdup_strings = 1; |
| 1115 | |
| 1116 | assert(!display_notes_trees); |
| 1117 | |
| 1118 | if (!opt || opt->use_default_notes > 0 || |
| 1119 | (opt->use_default_notes == -1 && !opt->extra_notes_refs.nr)) { |
| 1120 | string_list_append_nodup(&display_notes_refs, default_notes_ref(the_repository)); |
| 1121 | display_ref_env = getenv(GIT_NOTES_DISPLAY_REF_ENVIRONMENT); |
| 1122 | if (display_ref_env) { |
| 1123 | string_list_add_refs_from_colon_sep(&display_notes_refs, |
| 1124 | display_ref_env); |
| 1125 | load_config_refs = 0; |
| 1126 | } else |
| 1127 | load_config_refs = 1; |
| 1128 | } |
| 1129 | |
| 1130 | repo_config(the_repository, notes_display_config, &load_config_refs); |
| 1131 | |
| 1132 | if (opt) { |
| 1133 | struct string_list_item *item; |
| 1134 | for_each_string_list_item(item, &opt->extra_notes_refs) |
| 1135 | string_list_add_refs_by_glob(&display_notes_refs, |
| 1136 | item->string); |
| 1137 | } |
| 1138 | |
| 1139 | display_notes_trees = load_notes_trees(&display_notes_refs, 0); |
| 1140 | string_list_clear(&display_notes_refs, 0); |
| 1141 | } |
| 1142 | |
| 1143 | int add_note(struct notes_tree *t, const struct object_id *object_oid, |
| 1144 | const struct object_id *note_oid, combine_notes_fn combine_notes) |
no test coverage detected