Re: [PATCH] git-push: plumb in --mirror mode

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

 



Hi,

On Tue, 2 Oct 2007, Andy Whitcroft wrote:

> @@ -137,5 +144,10 @@ int cmd_push(int argc, const char **argv, const char *prefix)
>  	if (all && refspec)
>  		usage(push_usage);
>  
> +	if (modes_specified > 1) {
> +		error("--all and --mirror are incompatible");
> +		usage(push_usage);
> +	}
> +

Why not

	if ((flags & TRANSPORT_PUSH_ALL) && (flags & TRANSPORT_PUSH_MIRROR))?

It's more explicit.


> @@ -667,6 +673,8 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
>  		argv[argc++] = "--all";
>  	if (flags & TRANSPORT_PUSH_FORCE)
>  		argv[argc++] = "--force";
> +	if (flags & TRANSPORT_PUSH_MIRROR)
> +		argv[argc++] = "--mirror";
>  	if (data->receivepack) {
>  		char *rp = xmalloc(strlen(data->receivepack) + 16);
>  		sprintf(rp, "--receive-pack=%s", data->receivepack);

Shouldn't you then increment the "11" a few lines before that, to ensure 
enough space for the new argument?

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]

  Powered by Linux