parse-options-cb: convert to struct object_id
authorbrian m. carlson <sandals@crustytoothpaste.net>
Sat, 6 May 2017 22:09:59 +0000 (22:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 May 2017 06:12:57 +0000 (15:12 +0900)
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>
parse-options-cb.c
index 7419780a9b644e74107eec31d1c75156374920b8..35a941fddcc805e3c2f7115a142745f26a94ce77 100644 (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);