summaryrefslogtreecommitdiff
path: root/builtin/fsck.c
diff options
context:
space:
mode:
authorLibravatar Jonathan Tan <jonathantanmy@google.com>2017-12-05 16:58:46 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-12-05 09:46:05 -0800
commitcaba7fc31a0e2b5fd362577dd20c85a577c9f4e4 (patch)
treea9f2e324d3e95f84962060a4fa9b032367be52c1 /builtin/fsck.c
parentfsck: support refs pointing to promisor objects (diff)
downloadtgif-caba7fc31a0e2b5fd362577dd20c85a577c9f4e4.tar.xz
fsck: support referenced promisor objects
Teach fsck to not treat missing promisor objects indirectly pointed to by refs as an error when extensions.partialclone is set. 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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index ee937bbdbc..4c2a56d0c2 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -149,6 +149,15 @@ static int mark_object(struct object *obj, int type, void *data, struct fsck_opt
if (obj->flags & REACHABLE)
return 0;
obj->flags |= REACHABLE;
+
+ if (is_promisor_object(&obj->oid))
+ /*
+ * Further recursion does not need to be performed on this
+ * object since it is a promisor object (so it does not need to
+ * be added to "pending").
+ */
+ return 0;
+
if (!(obj->flags & HAS_OBJ)) {
if (parent && !has_object_file(&obj->oid)) {
printf("broken link from %7s %s\n",
@@ -208,6 +217,8 @@ static void check_reachable_object(struct object *obj)
* do a full fsck
*/
if (!(obj->flags & HAS_OBJ)) {
+ if (is_promisor_object(&obj->oid))
+ return;
if (has_sha1_pack(obj->oid.hash))
return; /* it is in pack - forget about it */
printf("missing %s %s\n", printable_type(obj),