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

Function parse_opt_commit

parse-options-cb.c:107–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int parse_opt_commit(const struct option *opt, const char *arg, int unset)
108{
109 struct object_id oid;
110 struct commit *commit;
111 struct commit **target = opt->value;
112
113 BUG_ON_OPT_NEG(unset);
114
115 if (!arg)
116 return -1;
117 if (repo_get_oid(the_repository, arg, &oid))
118 return error("malformed object name %s", arg);
119 commit = lookup_commit_reference(the_repository, &oid);
120 if (!commit)
121 return error("no such commit %s", arg);
122 *target = commit;
123 return 0;
124}
125
126int parse_opt_object_name(const struct option *opt, const char *arg, int unset)
127{

Callers

nothing calls this directly

Calls 3

repo_get_oidFunction · 0.85
errorFunction · 0.85
lookup_commit_referenceFunction · 0.85

Tested by

no test coverage detected