path: root/builtin/fsck.c
diff options
authorStefan Beller <>2018-06-29 01:21:52 (GMT)
committerJunio C Hamano <>2018-06-29 17:43:38 (GMT)
commit5abddd1eb72ca47cc84a9fc888c30ebaadde2eec (patch)
tree3aa159b370a0ecc3ac88e8b3453c049f72af15c3 /builtin/fsck.c
parent109cd76dd3467bd05f8d2145b857006649741d5c (diff)
object: add repository argument to lookup_object
Add a repository argument to allow callers of lookup_object to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Stefan Beller <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/fsck.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 2b09301..12d01e9 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -410,7 +410,7 @@ static void fsck_handle_reflog_oid(const char *refname, struct object_id *oid,
struct object *obj;
if (!is_null_oid(oid)) {
- obj = lookup_object(oid->hash);
+ obj = lookup_object(the_repository, oid->hash);
if (obj && (obj->flags & HAS_OBJ)) {
if (timestamp && name_objects)
@@ -763,7 +763,8 @@ int cmd_fsck(int argc, const char **argv, const char *prefix)
const char *arg = argv[i];
struct object_id oid;
if (!get_oid(arg, &oid)) {
- struct object *obj = lookup_object(oid.hash);
+ struct object *obj = lookup_object(the_repository,
+ oid.hash);
if (!obj || !(obj->flags & HAS_OBJ)) {
if (is_promisor_object(&oid))