return 0;
}
-static int fsck_handle_ref(const struct reference *ref, void *cb_data UNUSED)
+static int fsck_handle_ref(const struct reference *ref, void *cb_data)
{
+ struct repository *repo = cb_data;
struct object *obj;
- obj = parse_object(the_repository, ref->oid);
+ obj = parse_object(repo, ref->oid);
obj->flags |= USED;
fsck_put_object_name(&fsck_walk_options,
ref->oid, "%s", ref->name);
free(snap->ref);
}
-static void process_refs(struct snapshot *snap)
+static void process_refs(struct repository *repo, struct snapshot *snap)
{
struct worktree **worktrees, **p;
.name = snap->ref[i].refname,
.oid = &snap->ref[i].oid,
};
- fsck_handle_ref(&ref, NULL);
+ fsck_handle_ref(&ref, repo);
}
if (include_reflogs) {
}
/* Process the snapshotted refs and the reflogs. */
- process_refs(&snap);
+ process_refs(repo, &snap);
/* If not given any explicit objects, process index files too. */
if (!argc)