diff --git a/remote-curl.c b/remote-curl.c
index 6d3aff62daae382c2ae08c1f829208665ad5715a..5798aa57b6bf7f47f4fd9c8b943602faaeee4b95 100644 (file)
--- a/remote-curl.c
+++ b/remote-curl.c
http_init(remote);
do {
- if (strbuf_getline(&buf, stdin, '\n') == EOF)
+ if (strbuf_getline(&buf, stdin, '\n') == EOF) {
+ if (ferror(stdin))
+ fprintf(stderr, "Error reading command stream\n");
+ else
+ fprintf(stderr, "Unexpected end of command stream\n");
+ return 1;
+ }
+ if (buf.len == 0)
break;
if (!prefixcmp(buf.buf, "fetch ")) {
if (nongit)
printf("\n");
fflush(stdout);
} else {
+ fprintf(stderr, "Unknown command '%s'\n", buf.buf);
return 1;
}
strbuf_reset(&buf);