summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jonathan Tan <jonathantanmy@google.com>2017-02-23 10:43:03 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-02-23 12:14:40 -0800
commitbdb31eada76fd27d18e981c3b40889297fa889c6 (patch)
treeeb802e80ee702823fc0da89f0e45c18bb192828a
parentGit 2.11.1 (diff)
downloadtgif-bdb31eada76fd27d18e981c3b40889297fa889c6.tar.xz
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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--upload-pack.c6
1 files changed, 5 insertions, 1 deletions
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