mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
Merge branch 'jt/fetch-pack-error-reporting'
"git fetch-pack" was not prepared to accept ERR packet that the upload-pack can send with a human-readable error message. It showed the packet contents with ERR prefix, so there was no data loss, but it was redundant to say "ERR" in an error message. * jt/fetch-pack-error-reporting: fetch-pack: show clearer error message upon ERR
This commit is contained in:
commit
d2617eb984
|
@ -351,14 +351,19 @@ ACK after 'done' if there is at least one common base and multi_ack or
|
|||
multi_ack_detailed is enabled. The server always sends NAK after 'done'
|
||||
if there is no common base found.
|
||||
|
||||
Instead of 'ACK' or 'NAK', the server may send an error message (for
|
||||
example, if it does not recognize an object in a 'want' line received
|
||||
from the client).
|
||||
|
||||
Then the server will start sending its packfile data.
|
||||
|
||||
----
|
||||
server-response = *ack_multi ack / nak
|
||||
server-response = *ack_multi ack / nak / error-line
|
||||
ack_multi = PKT-LINE("ACK" SP obj-id ack_status)
|
||||
ack_status = "continue" / "common" / "ready"
|
||||
ack = PKT-LINE("ACK" SP obj-id)
|
||||
nak = PKT-LINE("NAK")
|
||||
error-line = PKT-LINE("ERR" SP explanation-text)
|
||||
----
|
||||
|
||||
A simple clone may look like this (with no 'have' lines):
|
||||
|
|
|
@ -276,6 +276,8 @@ static enum ack_type get_ack(int fd, unsigned char *result_sha1)
|
|||
return ACK;
|
||||
}
|
||||
}
|
||||
if (skip_prefix(line, "ERR ", &arg))
|
||||
die(_("remote error: %s"), arg);
|
||||
die(_("git fetch-pack: expected ACK/NAK, got '%s'"), line);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue