| 758 | } |
| 759 | |
| 760 | static int show(int argc, const char **argv, const char *prefix, |
| 761 | struct repository *repo UNUSED) |
| 762 | { |
| 763 | const char *object_ref; |
| 764 | struct notes_tree *t; |
| 765 | struct object_id object; |
| 766 | const struct object_id *note; |
| 767 | int retval; |
| 768 | struct option options[] = { |
| 769 | OPT_END() |
| 770 | }; |
| 771 | |
| 772 | argc = parse_options(argc, argv, prefix, options, git_notes_show_usage, |
| 773 | 0); |
| 774 | |
| 775 | if (1 < argc) { |
| 776 | error(_("too many arguments")); |
| 777 | usage_with_options(git_notes_show_usage, options); |
| 778 | } |
| 779 | |
| 780 | object_ref = argc ? argv[0] : "HEAD"; |
| 781 | |
| 782 | if (repo_get_oid(the_repository, object_ref, &object)) |
| 783 | die(_("failed to resolve '%s' as a valid ref."), object_ref); |
| 784 | |
| 785 | t = init_notes_check("show", 0); |
| 786 | note = get_note(t, &object); |
| 787 | |
| 788 | if (!note) |
| 789 | retval = error(_("no note found for object %s."), |
| 790 | oid_to_hex(&object)); |
| 791 | else { |
| 792 | const char *show_args[3] = {"show", oid_to_hex(note), NULL}; |
| 793 | retval = execv_git_cmd(show_args); |
| 794 | } |
| 795 | free_notes(t); |
| 796 | return retval; |
| 797 | } |
| 798 | |
| 799 | static int merge_abort(struct notes_merge_options *o) |
| 800 | { |
nothing calls this directly
no test coverage detected