git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Rename suffixcmp() to has_suffix()

From
Jeff King <peff@peff.net>
Date
Nov 4, 2013, 22:06 UTC
Message-ID
<20131104220650.GA26636@sigill.intra.peff.net>
In-Reply-To
<20131104214512.19757.74215.chriscool@tuxfamily.org>
On Mon, Nov 04, 2013 at 10:45:11PM +0100, Christian Couder wrote:
Show 10 quoted lines
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 874e0fd..4b8308e 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -510,7 +510,7 @@ static void write_followtags(const struct ref *refs, const char *msg)
>  	for (ref = refs; ref; ref = ref->next) {
>  		if (prefixcmp(ref->name, "refs/tags/"))
>  			continue;
> -		if (!suffixcmp(ref->name, "^{}"))
> +		if (!has_suffix(ref->name, "^{}"))

I think the intent of your patch is reasonable, but doesn't it flip the logic of the return value? That is, shouldn't this become:

  if (has_suffix(...))
?
-Peff
Previous: Christian Couder
Message 2 of 2 in “Rename suffixcmp() to has_suffix()”
  1. Rename suffixcmp() to has_suffix()Christian Couder, Nov 4, 2013
  2. Jeff KingNov 4, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.