From: Jonathan Tan Date: Fri, 03 Nov 2017 20:32:29 GMT Subject: Re: [PATCH 02/14] clone, fetch-pack, index-pack, transport: partial clone Message-ID: <20171103133229.1612a60560469af53c380a76@google.com> In-Reply-To: <20171102203129.59417-3-git@jeffhostetler.com> On Thu, 2 Nov 2017 20:31:17 +0000 Jeff Hostetler wrote: > From: Jeff Hostetler > > Signed-off-by: Jeff Hostetler > --- > builtin/clone.c | 9 +++++++++ > builtin/fetch-pack.c | 4 ++++ > builtin/index-pack.c | 10 ++++++++++ > fetch-pack.c | 13 +++++++++++++ > fetch-pack.h | 2 ++ > transport-helper.c | 5 +++++ > transport.c | 4 ++++ > transport.h | 5 +++++ > 8 files changed, 52 insertions(+) I managed to take a look at some of these patches. Firstly, consider separating out the clone part, since it will not be tested until a few patches later. > diff --git a/builtin/index-pack.c b/builtin/index-pack.c > index a0a35e6..31cd5ba 100644 > --- a/builtin/index-pack.c > +++ b/builtin/index-pack.c > @@ -222,6 +222,16 @@ static unsigned check_object(struct object *obj) > if (!(obj->flags & FLAG_CHECKED)) { > unsigned long size; > int type = sha1_object_info(obj->oid.hash, &size); > + > + if (type <= 0) { > + /* > + * TODO Use the promisor code to conditionally > + * try to fetch this object -or- assume it is ok. > + */ > + obj->flags |= FLAG_CHECKED; > + return 0; > + } > + > if (type <= 0) > die(_("did not receive expected object %s"), > oid_to_hex(&obj->oid)); This causes some repo corruption tests to fail. If I remove this and rebase the fetch-pack tests on top [1], the tests pass, so this might not be necessary (for now, at least). [1] https://github.com/jonathantanmy/git/commits/pc20171103