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