diff options
author | Jeff King <peff@peff.net> | 2013-03-16 06:27:01 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-16 22:16:56 -0700 |
commit | 06f15bf1f340f37293b471d8556842d4e89ff63f (patch) | |
tree | 9055a3e79db957bb1a75f7185e27db67b7a06d52 /t/t3403-rebase-skip.sh | |
parent | upload-pack: drop lookup-before-parse optimization (diff) | |
download | tgif-06f15bf1f340f37293b471d8556842d4e89ff63f.tar.xz |
upload-pack: make sure "want" objects are parsed
When upload-pack receives a "want" line from the client, it
adds it to an object array. We call lookup_object to find
the actual object, which will only check for objects already
in memory. This works because we are expecting to find
objects that we already loaded during the ref advertisement.
We use the resulting object structs for a variety of
purposes. Some of them care only about the object flags, but
others care about the type of the object (e.g.,
ok_to_give_up), or even feed them to the revision parser
(when --depth is used), which assumes that objects it
receives are fully parsed.
Once upon a time, this was OK; any object we loaded into
memory would also have been parsed. But since 435c833
(upload-pack: use peel_ref for ref advertisements,
2012-10-04), we try to avoid parsing objects during the ref
advertisement. This means that lookup_object may return an
object with a type of OBJ_NONE. The resulting mess depends
on the exact set of objects, but can include the revision
parser barfing, or the shallow code sending the wrong set of
objects.
This patch teaches upload-pack to parse each "want" object
as we receive it. We do not replace the lookup_object call
with parse_object, as the current code is careful not to let
just any object appear on a "want" line, but rather only one
we have previously advertised (whereas parse_object would
actually load any arbitrary object from disk).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3403-rebase-skip.sh')
0 files changed, 0 insertions, 0 deletions