MCPcopy Index your code
hub / github.com/git/git / prune

Function prune

builtin/notes.c:1078–1106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1076}
1077
1078static 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
1108static int get_ref(int argc, const char **argv, const char *prefix,
1109 struct repository *repo UNUSED)

Callers

nothing calls this directly

Calls 7

parse_optionsFunction · 0.85
errorFunction · 0.85
usage_with_optionsFunction · 0.85
init_notes_checkFunction · 0.85
prune_notesFunction · 0.85
commit_notesFunction · 0.85
free_notesFunction · 0.85

Tested by

no test coverage detected