Re: [PATCH v2 4/4] upload-archive: use start_command instead of fork
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 19, 2011, 21:09 UTC
- Message-ID
- <7vmxga7zb9.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1311012516-4836-5-git-send-email-kusmabite@gmail.com>
Erik Faye-Lund <kusmabite@gmail.com> writes:
Show 39 quoted lines
> @@ -18,28 +19,16 @@ static const char lostchild[] =
>
> #define MAX_ARGS (64)
>
> -static int run_upload_archive(int argc, const char **argv, const char *prefix)
> +static void prepare_argv(const char **sent_argv, const char **argv)
> {
> - const char *sent_argv[MAX_ARGS];
> const char *arg_cmd = "argument ";
> char *p, buf[4096];
> int sent_argc;
> int len;
>
> - if (argc != 2)
> - usage(upload_archive_usage);
> -
> - if (strlen(argv[1]) + 1 > sizeof(buf))
> - die("insanely long repository name");
> -
> - strcpy(buf, argv[1]); /* enter-repo smudges its argument */
> -
> - if (!enter_repo(buf, 0))
> - die("'%s' does not appear to be a git repository", buf);
> -
> /* put received options in sent_argv[] */
> sent_argc = 1;
> - sent_argv[0] = "git-upload-archive";
> + sent_argv[0] = "archive";
> for (p = buf;;) {
> /* This will die if not enough free space in buf */
> len = packet_read_line(0, p, (buf + sizeof buf) - p);
> @@ -62,9 +51,6 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix)
> *p++ = 0;
> }
> sent_argv[sent_argc] = NULL;
> -
> - /* parse all options sent by the client */
> - return write_archive(sent_argc, sent_argv, prefix, 0);
> }Hmm, how well would this change work with recent archive-filter work by Peff, especially with the "when remote, disable some features" bits?