diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-01-14 22:16:04 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-01-14 22:16:04 +0300 |
commit | 17069c7fae20f5e3082ee639066a37de5af6030e (patch) | |
tree | 52b612da693386eae08a4d87540c15744d468b13 /pkt-line.c | |
parent | ecbdaf0899161c067986e9d9d564586d4b045d62 (diff) | |
parent | 2d103c31c2cfcf03ff1408d639043469b0c93f70 (diff) |
Merge branch 'ms/packet-err-check' into jt/fetch-v2-sideband
* ms/packet-err-check:
pack-protocol.txt: accept error packets in any context
Use packet_reader instead of packet_read_line
Diffstat (limited to 'pkt-line.c')
-rw-r--r-- | pkt-line.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkt-line.c b/pkt-line.c index 04d10bbd03..e70ea6d88f 100644 --- a/pkt-line.c +++ b/pkt-line.c @@ -346,6 +346,10 @@ enum packet_read_status packet_read_with_status(int fd, char **src_buffer, return PACKET_READ_EOF; } + if ((options & PACKET_READ_DIE_ON_ERR_PACKET) && + starts_with(buffer, "ERR ")) + die(_("remote error: %s"), buffer + 4); + if ((options & PACKET_READ_CHOMP_NEWLINE) && len && buffer[len-1] == '\n') len--; |