summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-08-01 15:00:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-08-01 15:00:14 -0700
commit59d9ba869e900bf4da9822f417e4d40a710d8063 (patch)
tree07f1a07ddcff4c61e52cb959e6e7c0eec7abeb53 /remote-curl.c
parentMerge branch 'jc/maint-reset-unmerged-path' (diff)
parenttransport-helper: die early on encountering deleted refs (diff)
downloadtgif-59d9ba869e900bf4da9822f417e4d40a710d8063.tar.xz
Merge branch 'sr/transport-helper-fix'
* sr/transport-helper-fix: (21 commits) transport-helper: die early on encountering deleted refs transport-helper: implement marks location as capability transport-helper: Use capname for refspec capability too transport-helper: change import semantics transport-helper: update ref status after push with export transport-helper: use the new done feature where possible transport-helper: check status code of finish_command transport-helper: factor out push_update_refs_status fast-export: support done feature fast-import: introduce 'done' command git-remote-testgit: fix error handling git-remote-testgit: only push for non-local repositories remote-curl: accept empty line as terminator remote-helpers: export GIT_DIR variable to helpers git_remote_helpers: push all refs during a non-local export transport-helper: don't feed bogus refs to export push git-remote-testgit: import non-HEAD refs t5800: document some non-functional parts of remote helpers t5800: use skip_all instead of prereq t5800: factor out some ref tests ...
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 69831e931a..b8cf45a7dd 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);