Re: [PATCH] connect.c: add a way for git-daemon to pass an error back to client
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Nov 1, 2008, 18:10 UTC
- Message-ID
- <20081101181035.GB14706@spearce.org>
- In-Reply-To
- <b97024a40810312329o53e37fd5td82aa69634ff1e6b@mail.gmail.com>
Tom Preston-Werner <tom@github.com> wrote:
Show 16 quoted lines
>
> I saw several methods of testing for a specific prefix in connect.c.
> Looking more closely at the source, the closest similar call is
> actually the test for ACK:
>
> if (!prefixcmp(line, "ACK ")) {
> if (!get_sha1_hex(line+4, result_sha1)) {
> if (strstr(line+45, "continue"))
> return 2;
> return 1;
> }
> }
>
> Explicitly testing for "ERR " (including the space) does seem like the
> more correct thing to do. Would you like me to resubmit a modified
> patch that uses prefixcmp()?Yes, I think that is what Junio was hinting at. The pattern above is much more typical in Git sources, so keeping the new "ERR " check consistent would be appreciated.
-- Shawn.