summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2020-08-05 23:06:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-06 20:01:03 (GMT)
commit9eb86f41de7d229bb3a073e16e735cf71e2ffe3b (patch)
tree8273945a26de80729065b6e5d474079a9f996062 /builtin/fsck.c
parentee47243d7636d3d54b727ad24027a9167b68ebb1 (diff)
downloadgit-9eb86f41de7d229bb3a073e16e735cf71e2ffe3b.zip
git-9eb86f41de7d229bb3a073e16e735cf71e2ffe3b.tar.gz
git-9eb86f41de7d229bb3a073e16e735cf71e2ffe3b.tar.bz2
fsck: do not lazy fetch known non-promisor object
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>
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r--builtin/fsck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 37aa07d..fbf26ca 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),