summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-21 11:18:40 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-21 11:18:41 -0700
commit0ac744305f5885207bf96fc5488fcc59782ffa96 (patch)
tree6e2a5de0408f80d23a83dfe6baafb81fa9ca2aa1 /remote-curl.c
parent19a249ba83abb72faf530a214ea867feb51ade91 (diff)
parentcdaa4e98ca56586f78a455bd624457248347a56d (diff)
downloadgit-0ac744305f5885207bf96fc5488fcc59782ffa96.tar.gz
Merge branch 'jk/remote-curl-squelch-extra-errors'
* jk/remote-curl-squelch-extra-errors: remote-curl: mark helper-protocol errors more clearly remote-curl: use error instead of fprintf(stderr) remote-curl: do not complain on EOF from parent git
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/remote-curl.c b/remote-curl.c
index cdcca2903b..0fcf2ce5ff 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -399,7 +399,7 @@ static curlioerr rpc_ioctl(CURL *handle, int cmd, void *clientp)
rpc->pos = 0;
return CURLIOE_OK;
}
- fprintf(stderr, "Unable to rewind rpc post data - try increasing http.postBuffer\n");
+ error("unable to rewind rpc post data - try increasing http.postBuffer");
return CURLIOE_FAILRESTART;
default:
@@ -709,7 +709,7 @@ static int fetch_dumb(int nr_heads, struct ref **to_fetch)
free(targets[i]);
free(targets);
- return ret ? error("Fetch failed.") : 0;
+ return ret ? error("fetch failed.") : 0;
}
static int fetch_git(struct discovery *heads,
@@ -949,7 +949,7 @@ int main(int argc, const char **argv)
git_extract_argv0_path(argv[0]);
setup_git_directory_gently(&nongit);
if (argc < 2) {
- fprintf(stderr, "Remote needed\n");
+ error("remote-curl: usage: git remote-curl <remote> [<url>]");
return 1;
}
@@ -972,16 +972,14 @@ int main(int argc, const char **argv)
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");
+ error("remote-curl: error reading command stream from git");
return 1;
}
if (buf.len == 0)
break;
if (starts_with(buf.buf, "fetch ")) {
if (nongit)
- die("Fetch attempted without a local repo");
+ die("remote-curl: fetch attempted without a local repo");
parse_fetch(&buf);
} else if (!strcmp(buf.buf, "list") || starts_with(buf.buf, "list ")) {
@@ -1017,7 +1015,7 @@ int main(int argc, const char **argv)
printf("\n");
fflush(stdout);
} else {
- fprintf(stderr, "Unknown command '%s'\n", buf.buf);
+ error("remote-curl: unknown command '%s' from git", buf.buf);
return 1;
}
strbuf_reset(&buf);