commit: add repository argument to lookup_commit_reference
[gitweb.git] / sha1-name.c
index 60d9ef3c7e7108c859647656972c171cce4e7d7f..325915fb276b50b67d565a022094510f68345106 100644 (file)
@@ -239,7 +239,7 @@ static int disambiguate_committish_only(const struct object_id *oid, void *cb_da
                return 0;
 
        /* We need to do this the hard way... */
-       obj = deref_tag(parse_object(oid), NULL, 0);
+       obj = deref_tag(parse_object(the_repository, oid), NULL, 0);
        if (obj && obj->type == OBJ_COMMIT)
                return 1;
        return 0;
@@ -263,7 +263,7 @@ static int disambiguate_treeish_only(const struct object_id *oid, void *cb_data_
                return 0;
 
        /* We need to do this the hard way... */
-       obj = deref_tag(parse_object(oid), NULL, 0);
+       obj = deref_tag(parse_object(the_repository, oid), NULL, 0);
        if (obj && (obj->type == OBJ_TREE || obj->type == OBJ_COMMIT))
                return 1;
        return 0;
@@ -844,7 +844,7 @@ static int get_parent(const char *name, int len,
 
        if (ret)
                return ret;
-       commit = lookup_commit_reference(&oid);
+       commit = lookup_commit_reference(the_repository, &oid);
        if (parse_commit(commit))
                return -1;
        if (!idx) {
@@ -872,7 +872,7 @@ static int get_nth_ancestor(const char *name, int len,
        ret = get_oid_1(name, len, &oid, GET_OID_COMMITTISH);
        if (ret)
                return ret;
-       commit = lookup_commit_reference(&oid);
+       commit = lookup_commit_reference(the_repository, &oid);
        if (!commit)
                return -1;
 
@@ -891,7 +891,7 @@ struct object *peel_to_type(const char *name, int namelen,
        if (name && !namelen)
                namelen = strlen(name);
        while (1) {
-               if (!o || (!o->parsed && !parse_object(&o->oid)))
+               if (!o || (!o->parsed && !parse_object(the_repository, &o->oid)))
                        return NULL;
                if (expected_type == OBJ_ANY || o->type == expected_type)
                        return o;
@@ -964,12 +964,12 @@ static int peel_onion(const char *name, int len, struct object_id *oid,
        if (get_oid_1(name, sp - name - 2, &outer, lookup_flags))
                return -1;
 
-       o = parse_object(&outer);
+       o = parse_object(the_repository, &outer);
        if (!o)
                return -1;
        if (!expected_type) {
                o = deref_tag(o, name, sp - name - 2);
-               if (!o || (!o->parsed && !parse_object(&o->oid)))
+               if (!o || (!o->parsed && !parse_object(the_repository, &o->oid)))
                        return -1;
                oidcpy(oid, &o->oid);
                return 0;
@@ -1096,7 +1096,7 @@ static int handle_one_ref(const char *path, const struct object_id *oid,
                          int flag, void *cb_data)
 {
        struct commit_list **list = cb_data;
-       struct object *object = parse_object(oid);
+       struct object *object = parse_object(the_repository, oid);
        if (!object)
                return 0;
        if (object->type == OBJ_TAG) {
@@ -1142,7 +1142,7 @@ static int get_oid_oneline(const char *prefix, struct object_id *oid,
                int matches;
 
                commit = pop_most_recent_commit(&list, ONELINE_SEEN);
-               if (!parse_object(&commit->object.oid))
+               if (!parse_object(the_repository, &commit->object.oid))
                        continue;
                buf = get_commit_buffer(commit, NULL);
                p = strstr(buf, "\n\n");
@@ -1251,13 +1251,13 @@ int get_oid_mb(const char *name, struct object_id *oid)
        }
        if (st)
                return st;
-       one = lookup_commit_reference_gently(&oid_tmp, 0);
+       one = lookup_commit_reference_gently(the_repository, &oid_tmp, 0);
        if (!one)
                return -1;
 
        if (get_oid_committish(dots[3] ? (dots + 3) : "HEAD", &oid_tmp))
                return -1;
-       two = lookup_commit_reference_gently(&oid_tmp, 0);
+       two = lookup_commit_reference_gently(the_repository, &oid_tmp, 0);
        if (!two)
                return -1;
        mbs = get_merge_bases(one, two);