Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-14 22:16:04 +0300
committerJunio C Hamano <gitster@pobox.com>2019-01-14 22:16:04 +0300
commit17069c7fae20f5e3082ee639066a37de5af6030e (patch)
tree52b612da693386eae08a4d87540c15744d468b13 /pkt-line.c
parentecbdaf0899161c067986e9d9d564586d4b045d62 (diff)
parent2d103c31c2cfcf03ff1408d639043469b0c93f70 (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.c4
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--;