X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=remote-curl.c;h=b8cf45a7dd439b83c80bcf7a397e1b8e34c70f67;hb=411e6cf1971936ba31ffa142a6d5dc5c06dc8f7a;hp=69831e931af1fe2a3e668239e8c4bb73a7bfb936;hpb=5a277f3ff7cb57e35ce574e93866b6c7e3bf8971;p=git.git diff --git a/remote-curl.c b/remote-curl.c index 69831e931..b8cf45a7d 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -855,7 +855,14 @@ int main(int argc, const char **argv) 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) @@ -895,6 +902,7 @@ int main(int argc, const char **argv) printf("\n"); fflush(stdout); } else { + fprintf(stderr, "Unknown command '%s'\n", buf.buf); return 1; } strbuf_reset(&buf);