| 1076 | } |
| 1077 | |
| 1078 | static int prune(int argc, const char **argv, const char *prefix, |
| 1079 | struct repository *repo UNUSED) |
| 1080 | { |
| 1081 | struct notes_tree *t; |
| 1082 | int show_only = 0, verbose = 0; |
| 1083 | struct option options[] = { |
| 1084 | OPT__DRY_RUN(&show_only, N_("do not remove, show only")), |
| 1085 | OPT__VERBOSE(&verbose, N_("report pruned notes")), |
| 1086 | OPT_END() |
| 1087 | }; |
| 1088 | |
| 1089 | argc = parse_options(argc, argv, prefix, options, git_notes_prune_usage, |
| 1090 | 0); |
| 1091 | |
| 1092 | if (argc) { |
| 1093 | error(_("too many arguments")); |
| 1094 | usage_with_options(git_notes_prune_usage, options); |
| 1095 | } |
| 1096 | |
| 1097 | t = init_notes_check("prune", NOTES_INIT_WRITABLE); |
| 1098 | |
| 1099 | prune_notes(t, (verbose ? NOTES_PRUNE_VERBOSE : 0) | |
| 1100 | (show_only ? NOTES_PRUNE_VERBOSE|NOTES_PRUNE_DRYRUN : 0) ); |
| 1101 | if (!show_only) |
| 1102 | commit_notes(the_repository, t, |
| 1103 | "Notes removed by 'git notes prune'"); |
| 1104 | free_notes(t); |
| 1105 | return 0; |
| 1106 | } |
| 1107 | |
| 1108 | static int get_ref(int argc, const char **argv, const char *prefix, |
| 1109 | struct repository *repo UNUSED) |
nothing calls this directly
no test coverage detected