mirror of
https://github.com/git/git.git
synced 2024-11-28 20:44:04 +08:00
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>
This commit is contained in:
parent
3b9e3c2ced
commit
bdb31eada7
@ -822,9 +822,13 @@ static void receive_needs(void)
|
|||||||
use_include_tag = 1;
|
use_include_tag = 1;
|
||||||
|
|
||||||
o = parse_object(sha1_buf);
|
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",
|
die("git upload-pack: not our ref %s",
|
||||||
sha1_to_hex(sha1_buf));
|
sha1_to_hex(sha1_buf));
|
||||||
|
}
|
||||||
if (!(o->flags & WANTED)) {
|
if (!(o->flags & WANTED)) {
|
||||||
o->flags |= WANTED;
|
o->flags |= WANTED;
|
||||||
if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1
|
if (!((allow_unadvertised_object_request & ALLOW_ANY_SHA1) == ALLOW_ANY_SHA1
|
||||||
|
Loading…
Reference in New Issue
Block a user