diff options
Diffstat (limited to 'remote-curl.c')
-rw-r--r-- | remote-curl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/remote-curl.c b/remote-curl.c index d69156312b..ff44f41011 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -1061,7 +1061,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads, client.in = -1; client.out = -1; client.git_cmd = 1; - client.argv = client_argv; + strvec_pushv(&client.args, client_argv); if (start_command(&client)) exit(1); write_or_die(client.in, preamble->buf, preamble->len); @@ -1472,11 +1472,12 @@ int cmd_main(int argc, const char **argv) { struct strbuf buf = STRBUF_INIT; int nongit; + int ret = 1; setup_git_directory_gently(&nongit); if (argc < 2) { error(_("remote-curl: usage: git remote-curl <remote> [<url>]")); - return 1; + goto cleanup; } options.verbosity = 1; @@ -1508,7 +1509,7 @@ int cmd_main(int argc, const char **argv) if (strbuf_getline_lf(&buf, stdin) == EOF) { if (ferror(stdin)) error(_("remote-curl: error reading command stream from git")); - return 1; + goto cleanup; } if (buf.len == 0) break; @@ -1556,12 +1557,15 @@ int cmd_main(int argc, const char **argv) break; } else { error(_("remote-curl: unknown command '%s' from git"), buf.buf); - return 1; + goto cleanup; } strbuf_reset(&buf); } while (1); http_cleanup(); + ret = 0; +cleanup: + strbuf_release(&buf); - return 0; + return ret; } |