From 81d340d40af506eda3182190b6132575547fa4c5 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Wed, 10 Apr 2013 17:15:52 -0400 Subject: transport-helper: report errors properly If a push fails because the remote-helper died (with fast-export), the user may not see any error message. We do correctly die with a failed exit code, as we notice that the helper has died while reading back the ref status from the helper. However, we don't print any message. This is OK if the helper itself printed a useful error message, but we cannot count on that; let's let the user know that the helper failed. In the long run, it may make more sense to propagate the error back up to push, so that it can present the usual status table and give a nicer message. But this is a much simpler fix that can help immediately. While we're adding tests, let's also confirm that the remote-helper dying is also detected when importing refs. We currently do so robustly when the helper uses the "done" feature (and that is what we test). We cannot do so reliably when the helper does not use the "done" feature, but it is not even worth testing; the right solution is for the helper to start using "done". Suggested-by: Jeff King Signed-off-by: Felipe Contreras Signed-off-by: Jeff King Acked-by: Sverre Rabbelier Signed-off-by: Junio C Hamano --- transport-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'transport-helper.c') diff --git a/transport-helper.c b/transport-helper.c index cb3ef7d38..96081cc39 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -54,7 +54,7 @@ static int recvline_fh(FILE *helper, struct strbuf *buffer) if (strbuf_getline(buffer, helper, '\n') == EOF) { if (debug) fprintf(stderr, "Debug: Remote helper quit.\n"); - exit(128); + die("Reading from remote helper failed"); } if (debug) -- cgit v1.2.1