1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 05:46:07 +02:00

parse-options-cb: convert to struct object_id

This is a caller of lookup_commit_reference, which we will soon convert.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2017-05-06 22:09:59 +00:00 committed by Junio C Hamano
parent 569aa376ea
commit 9e31eafe7e

View File

@ -80,14 +80,14 @@ int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
int parse_opt_commits(const struct option *opt, const char *arg, int unset)
{
unsigned char sha1[20];
struct object_id oid;
struct commit *commit;
if (!arg)
return -1;
if (get_sha1(arg, sha1))
if (get_oid(arg, &oid))
return error("malformed object name %s", arg);
commit = lookup_commit_reference(sha1);
commit = lookup_commit_reference(oid.hash);
if (!commit)
return error("no such commit %s", arg);
commit_list_insert(commit, opt->value);