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
@ -26,8 +26,8 @@ int cmd__example_decorate(int argc, const char **argv)
|
||||
* Add 2 objects, one with a non-NULL decoration and one with a NULL
|
||||
* decoration.
|
||||
*/
|
||||
one = lookup_unknown_object(&one_oid);
|
||||
two = lookup_unknown_object(&two_oid);
|
||||
one = lookup_unknown_object(the_repository, &one_oid);
|
||||
two = lookup_unknown_object(the_repository, &two_oid);
|
||||
ret = add_decoration(&n, one, &decoration_a);
|
||||
if (ret)
|
||||
BUG("when adding a brand-new object, NULL should be returned");
|
||||
@ -56,7 +56,7 @@ int cmd__example_decorate(int argc, const char **argv)
|
||||
ret = lookup_decoration(&n, two);
|
||||
if (ret != &decoration_b)
|
||||
BUG("lookup should return added declaration");
|
||||
three = lookup_unknown_object(&three_oid);
|
||||
three = lookup_unknown_object(the_repository, &three_oid);
|
||||
ret = lookup_decoration(&n, three);
|
||||
if (ret)
|
||||
BUG("lookup for unknown object should return NULL");
|
||||
|
Reference in New Issue
Block a user