| 1226 | } |
| 1227 | |
| 1228 | void prune_notes(struct notes_tree *t, int flags) |
| 1229 | { |
| 1230 | struct note_delete_list *l = NULL; |
| 1231 | |
| 1232 | if (!t) |
| 1233 | t = &default_notes_tree; |
| 1234 | assert(t->initialized); |
| 1235 | |
| 1236 | for_each_note(t, 0, prune_notes_helper, &l); |
| 1237 | |
| 1238 | while (l) { |
| 1239 | struct note_delete_list *next; |
| 1240 | |
| 1241 | if (flags & NOTES_PRUNE_VERBOSE) |
| 1242 | printf("%s\n", hash_to_hex(l->sha1)); |
| 1243 | if (!(flags & NOTES_PRUNE_DRYRUN)) |
| 1244 | remove_note(t, l->sha1); |
| 1245 | |
| 1246 | next = l->next; |
| 1247 | free(l); |
| 1248 | l = next; |
| 1249 | } |
| 1250 | } |
| 1251 | |
| 1252 | void free_notes(struct notes_tree *t) |
| 1253 | { |
no test coverage detected