Re: [PATCH v3] Allow update hooks to update refs on their own

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

 



On Wed, Nov 28, 2007 at 02:14:03PM -0800, Steven Grimm wrote:

> @@ -177,7 +179,16 @@ static int receive_status(int in, struct ref *refs)
>  
>  		line[strlen(line)-1] = '\0';
>  		refname = line + 3;
> -		msg = strchr(refname, ' ');
> +		newsha1_hex = strchr(refname, ' ');
> +		if (newsha1_hex) {
> +			*newsha1_hex++ = '\0';
> +			if (get_sha1_hex(newsha1_hex, newsha1)) {
> +				fprintf(stderr, "protocol error: bad sha1 %s\n",
> +					newsha1_hex);
> +				newsha1_hex = NULL;
> +			}
> +		}
> +		msg = strchr(newsha1_hex, ' ');
>  		if (msg)
>  			*msg++ = '\0';

Doesn't this always put the first "word" of a response into newsha1_hex?
We want to do this only for 'ok' responses; 'ng' responses are already
using that space as part of the error message.

-Peff
-
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