lookup_unknown_object(): take a repository argument
All of the other lookup_foo() functions take a repository argument, but lookup_unknown_object() was never converted, and it uses the_repository internally. Let's fix that. We could leave a wrapper that uses the_repository, but there aren't that many calls, so we'll just convert them all. I looked briefly at each site to see if we had a repository struct (besides the_repository) we could pass, but none of them do (so this conversion to pass the_repository is a pure noop in each case, though it does take us one step closer to eventually getting rid of the_repository). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
fcc07e980b
commit
45a187cc34
7
object.c
7
object.c
@ -177,12 +177,11 @@ void *object_as_type(struct object *obj, enum object_type type, int quiet)
|
||||
}
|
||||
}
|
||||
|
||||
struct object *lookup_unknown_object(const struct object_id *oid)
|
||||
struct object *lookup_unknown_object(struct repository *r, const struct object_id *oid)
|
||||
{
|
||||
struct object *obj = lookup_object(the_repository, oid);
|
||||
struct object *obj = lookup_object(r, oid);
|
||||
if (!obj)
|
||||
obj = create_object(the_repository, oid,
|
||||
alloc_object_node(the_repository));
|
||||
obj = create_object(r, oid, alloc_object_node(r));
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user