]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fsck: do not lazy fetch known non-promisor object
authorJonathan Tan <jonathantanmy@google.com>
Wed, 5 Aug 2020 23:06:52 +0000 (16:06 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Aug 2020 20:01:03 +0000 (13:01 -0700)
There is a call to has_object_file(), which lazily fetches missing
objects in a partial clone, when the object is known to not be
a promisor object. Change that call to has_object(), which does not do
any lazy fetching.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c

index 37aa07da78ebe9130c4d48865810bfc87d9f4ea0..fbf26cafcfd7d42fa779f449cf53eb7d9a6d5ea0 100644 (file)
@@ -168,7 +168,7 @@ static int mark_object(struct object *obj, int type, void *data, struct fsck_opt
                return 0;
 
        if (!(obj->flags & HAS_OBJ)) {
-               if (parent && !has_object_file(&obj->oid)) {
+               if (parent && !has_object(the_repository, &obj->oid, 1)) {
                        printf_ln(_("broken link from %7s %s\n"
                                    "              to %7s %s"),
                                  printable_type(&parent->oid, parent->type),