Re: [RFC/PATCH 3/6] Move setup of curl remote helper from transport.c to transport-helper.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, 11 Aug 2009, Johan Herland wrote:

> diff --git a/transport-helper.c b/transport-helper.c
> index a901630..d3ce984 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> @@ -249,6 +249,34 @@ static struct ref *get_refs_list(struct transport *transport, int for_push)
>  	return ret;
>  }
>  
> +#ifndef NO_CURL
> +static int curl_transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags)
> +{
> +	const char **argv;
> +	int argc;
> +
> +	if (flags & TRANSPORT_PUSH_MIRROR)
> +		return error("http transport does not support mirror mode");
> +
> +	argv = xmalloc((refspec_nr + 12) * sizeof(char *));
> +	argv[0] = "http-push";
> +	argc = 1;
> +	if (flags & TRANSPORT_PUSH_ALL)
> +		argv[argc++] = "--all";
> +	if (flags & TRANSPORT_PUSH_FORCE)
> +		argv[argc++] = "--force";
> +	if (flags & TRANSPORT_PUSH_DRY_RUN)
> +		argv[argc++] = "--dry-run";
> +	if (flags & TRANSPORT_PUSH_VERBOSE)
> +		argv[argc++] = "--verbose";
> +	argv[argc++] = transport->url;
> +	while (refspec_nr--)
> +		argv[argc++] = *refspec++;
> +	argv[argc] = NULL;
> +	return !!run_command_v_opt(argv, RUN_GIT_CMD);
> +}
> +#endif
> +
>  int transport_helper_init(struct transport *transport)
>  {
>  	struct helper_data *data = xcalloc(sizeof(*data), 1);
> @@ -269,5 +297,16 @@ int transport_helper_init(struct transport *transport)
>  	transport->get_refs_list = get_refs_list;
>  	transport->fetch = fetch;
>  	transport->disconnect = disconnect_helper;
> +
> +	if (!strcmp(data->name, "http")
> +	 || !strcmp(data->name, "https")
> +	 || !strcmp(data->name, "ftp")) {
> +#ifdef NO_CURL
> +		error("git was compiled without libcurl support.");
> +#else
> +		transport->push = curl_transport_push;
> +#endif
> +	}
> +
>  	return 0;
>  }

I still find it rather, uhm, confusing that copying git-http-push and/or 
git-remote-http into place will still give you the error message "Git was 
compiled without libcurl support".

It's just as well that I do not need to maintain RPMs or DEBs.

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]