From: Jonathan Tan Date: Thu, 23 Feb 2017 18:43:03 +0000 (-0800) Subject: upload-pack: report "not our ref" to client X-Git-Tag: v2.12.2~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdb31ea;p=thirdparty%2Fgit.git upload-pack: report "not our ref" to client Make upload-pack report "not our ref" errors to the client as an "ERR" line. (If not, the client would be left waiting for a response when the server is already dead.) Signed-off-by: Jonathan Tan Signed-off-by: Junio C Hamano --- diff --git a/upload-pack.c b/upload-pack.c index 7597ba3405..ffb028d623 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -822,9 +822,13 @@ static void receive_needs(void) use_include_tag = 1; o = parse_object(sha1_buf); - if (!o) + if (!o) { + packet_write_fmt(1, + "ERR upload-pack: not our ref %s", + sha1_to_hex(sha1_buf)); die("git upload-pack: not our ref %s", sha1_to_hex(sha1_buf)); + } if (!(o->flags & WANTED)) { o->flags |= WANTED; if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1