Skip to content

Commit bdb31ea

Browse files
jonathantanmygitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b9e3c2 commit bdb31ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

upload-pack.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,9 +822,13 @@ static void receive_needs(void)
822822
use_include_tag = 1;
823823

824824
o = parse_object(sha1_buf);
825-
if (!o)
825+
if (!o) {
826+
packet_write_fmt(1,
827+
"ERR upload-pack: not our ref %s",
828+
sha1_to_hex(sha1_buf));
826829
die("git upload-pack: not our ref %s",
827830
sha1_to_hex(sha1_buf));
831+
}
828832
if (!(o->flags & WANTED)) {
829833
o->flags |= WANTED;
830834
if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1

0 commit comments

Comments
 (0)