From af04fa2a78af3f4dc07bdc3e3018ccf3baa88c20 Mon Sep 17 00:00:00 2001 From: Michael Heemskerk Date: Sun, 28 Apr 2013 22:32:04 -0700 Subject: upload-pack: ignore 'shallow' lines with unknown obj-ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the client sends a 'shallow' line for an object that the server does not have, the server currently dies with the error: "did not find object for shallow ". The client may have truncated the history at the commit by fetching shallowly from a different server, or the commit may have been garbage collected by the server. In either case, this unknown commit is not relevant for calculating the pack that is to be sent and can be safely ignored, and it is not used when recomputing where the updated history of the client is cauterised. The documentation in technical/pack-protocol.txt has been updated to remove the restriction that "Clients MUST NOT mention an obj-id which it does not know exists on the server". This requirement is not realistic because clients cannot know whether an object has been garbage collected by the server. Signed-off-by: Michael Heemskerk Reviewed-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'upload-pack.c') diff --git a/upload-pack.c b/upload-pack.c index bfa6279cc4..127e59a603 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -592,7 +592,7 @@ static void receive_needs(void) die("invalid shallow line: %s", line); object = parse_object(sha1); if (!object) - die("did not find object for %s", line); + continue; if (object->type != OBJ_COMMIT) die("invalid shallow object %s", sha1_to_hex(sha1)); if (!(object->flags & CLIENT_SHALLOW)) { -- cgit v1.2.1