| 416 | } |
| 417 | |
| 418 | static 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 | |
| 437 | static int list(int argc, const char **argv, const char *prefix, |
| 438 | struct repository *repo UNUSED) |
no test coverage detected