MCPcopy Create free account
hub / github.com/git/git / show

Function show

builtin/notes.c:760–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

758}
759
760static 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
799static int merge_abort(struct notes_merge_options *o)
800{

Callers

nothing calls this directly

Calls 10

parse_optionsFunction · 0.85
errorFunction · 0.85
usage_with_optionsFunction · 0.85
repo_get_oidFunction · 0.85
init_notes_checkFunction · 0.85
get_noteFunction · 0.85
oid_to_hexFunction · 0.85
execv_git_cmdFunction · 0.85
free_notesFunction · 0.85
dieFunction · 0.50

Tested by

no test coverage detected