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

Function parse_opt_commits

parse-options-cb.c:89–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89int parse_opt_commits(const struct option *opt, const char *arg, int unset)
90{
91 struct object_id oid;
92 struct commit *commit;
93
94 BUG_ON_OPT_NEG(unset);
95
96 if (!arg)
97 return -1;
98 if (repo_get_oid(the_repository, arg, &oid))
99 return error("malformed object name %s", arg);
100 commit = lookup_commit_reference(the_repository, &oid);
101 if (!commit)
102 return error("no such commit %s", arg);
103 commit_list_insert(commit, opt->value);
104 return 0;
105}
106
107int parse_opt_commit(const struct option *opt, const char *arg, int unset)
108{

Callers

nothing calls this directly

Calls 4

repo_get_oidFunction · 0.85
errorFunction · 0.85
lookup_commit_referenceFunction · 0.85
commit_list_insertFunction · 0.85

Tested by

no test coverage detected