mirror of
https://github.com/git/git.git
synced 2024-11-23 18:05:29 +08:00
remote-curl: mark helper-protocol errors more clearly
When we encounter an error in remote-curl, we generally just report it to stderr. There is no need for the user to care that the "could not connect to server" error was generated by git-remote-https rather than a function in the parent git-fetch process. However, when the error is in the protocol between git and the helper, it makes sense to clearly identify which side is complaining. These cases shouldn't ever happen, but when they do, we can make them less confusing by being more verbose. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b725b270d1
commit
cdaa4e98ca
@ -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) {
|
||||
error("remote needed");
|
||||
error("remote-curl: usage: git remote-curl <remote> [<url>]");
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -970,14 +970,14 @@ int main(int argc, const char **argv)
|
||||
do {
|
||||
if (strbuf_getline(&buf, stdin, '\n') == EOF) {
|
||||
if (ferror(stdin))
|
||||
error("error reading command stream");
|
||||
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 ")) {
|
||||
@ -1014,7 +1014,7 @@ int main(int argc, const char **argv)
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
} else {
|
||||
error("unknown command '%s'", buf.buf);
|
||||
error("remote-curl: unknown command '%s' from git", buf.buf);
|
||||
return 1;
|
||||
}
|
||||
strbuf_reset(&buf);
|
||||
|
Loading…
Reference in New Issue
Block a user