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

Function init_notes_check

builtin/notes.c:418–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

416}
417
418static struct notes_tree *init_notes_check(const char *subcommand,
419 int flags)
420{
421 struct notes_tree *t;
422 const char *ref;
423 init_notes(NULL, NULL, NULL, flags);
424 t = &default_notes_tree;
425
426 ref = (flags & NOTES_INIT_WRITABLE) ? t->update_ref : t->ref;
427 if (!starts_with(ref, "refs/notes/"))
428 /*
429 * TRANSLATORS: the first %s will be replaced by a git
430 * notes command: 'add', 'merge', 'remove', etc.
431 */
432 die(_("refusing to %s notes in %s (outside of refs/notes/)"),
433 subcommand, ref);
434 return t;
435}
436
437static int list(int argc, const char **argv, const char *prefix,
438 struct repository *repo UNUSED)

Callers 8

listFunction · 0.85
addFunction · 0.85
copyFunction · 0.85
append_editFunction · 0.85
showFunction · 0.85
mergeFunction · 0.85
remove_cmdFunction · 0.85
pruneFunction · 0.85

Calls 3

init_notesFunction · 0.85
starts_withFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected