Subject: Re: [PATCH 08/16] use skip_prefix to avoid magic numbers

From: Junio C Hamano <[email-masked]>
Date: Mon, 23 Jun 2014 14:44:23 -0700

Jeff King <[email-masked]> writes:

> diff --git a/connect.c b/connect.c
> index 94a6650..37ff018 100644
> --- a/connect.c
> +++ b/connect.c
> @@ -140,12 +141,12 @@ struct ref **get_remote_heads(int in, char *src_buf, size_t src_len,
>  		if (!len)
>  			break;
>  
> -		if (len > 4 && starts_with(buffer, "ERR "))
> -			die("remote error: %s", buffer + 4);
> +		if (len > 4 && skip_prefix(buffer, "ERR ", &arg))
> +			die("remote error: %s", arg);

Makes one wonder if we should do something special to a line with
only "ERR " and nothing else on it, which the other end may have
meant us to give a blank line to make the output more readable.

A fix, if one turns out to be needed, is outside the scope of this
patch, though, I think.