summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d2e73c6)
raw | patch | inline | side by side (parent: d2e73c6)
author | Sverre Rabbelier <srabbelier@gmail.com> | |
Sat, 16 Jul 2011 13:03:35 +0000 (15:03 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 19 Jul 2011 18:17:47 +0000 (11:17 -0700) |
Previously the status code of all helpers were ignored, allowing
errors that occur to go unnoticed if the error text output by the
helper is not noticed.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
errors that occur to go unnoticed if the error text output by the
helper is not noticed.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper.c | patch | blob | history |
diff --git a/transport-helper.c b/transport-helper.c
index dd8dd2c1aebb94b06b6a118d88f4a78ac6cefe45..e02f4a3e5a1bdbdbd1cfa7a9a1a449e3643485df 100644 (file)
--- a/transport-helper.c
+++ b/transport-helper.c
{
struct helper_data *data = transport->data;
struct strbuf buf = STRBUF_INIT;
+ int res = 0;
if (data->helper) {
if (debug)
close(data->helper->in);
close(data->helper->out);
fclose(data->out);
- finish_command(data->helper);
+ res = finish_command(data->helper);
free((char *)data->helper->argv[0]);
free(data->helper->argv);
free(data->helper);
data->helper = NULL;
}
- return 0;
+ return res;
}
static const char *unsupported_options[] = {
static int release_helper(struct transport *transport)
{
+ int res = 0;
struct helper_data *data = transport->data;
free_refspec(data->refspec_nr, data->refspecs);
data->refspecs = NULL;
- disconnect_helper(transport);
+ res = disconnect_helper(transport);
free(transport->data);
- return 0;
+ return res;
}
static int fetch_with_fetch(struct transport *transport,
sendline(data, &buf);
strbuf_reset(&buf);
}
- disconnect_helper(transport);
- finish_command(&fastimport);
+ if (disconnect_helper(transport))
+ die("Error while disconnecting helper");
+ if (finish_command(&fastimport))
+ die("Error while running fast-import");
+
free(fastimport.argv);
fastimport.argv = NULL;
die("Couldn't run fast-export");
data->no_disconnect_req = 1;
- finish_command(&exporter);
- disconnect_helper(transport);
+ if (finish_command(&exporter))
+ die("Error while running fast-export");
+ if (disconnect_helper(transport))
+ die("Error while disconnecting helper");
return 0;
}