diff mbox series

[v2,4/4] fsck: do not lazy fetch known non-promisor object

Message ID efa3b0719d628bbbd3923725c2d8e0c0d0018876.1596668156.git.jonathantanmy@google.com (mailing list archive)
State Accepted
Commit 9eb86f41de7d229bb3a073e16e735cf71e2ffe3b
Headers show
Series No-lazy-fetch has_object() and some fixes | expand

Commit Message

Jonathan Tan Aug. 5, 2020, 11:06 p.m. UTC
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>
---
 builtin/fsck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/builtin/fsck.c b/builtin/fsck.c
index 37aa07da78..fbf26cafcf 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -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),