Re: [PATCH 5/6] push: use same rules as git-rev-parse to resolve refspecs

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

 




On Nov 12, 2007, at 8:51 PM, Junio C Hamano wrote:

Steffen Prohaska <prohaska@xxxxxx> writes:

diff --git a/remote.c b/remote.c
index bec2ba1..28d8eb7 100644
--- a/remote.c
+++ b/remote.c
@@ -519,10 +519,7 @@ static int count_refspec_match(const char *pattern,
 		char *name = refs->name;
 		int namelen = strlen(name);

-		if (namelen < patlen ||
-		    memcmp(name + namelen - patlen, pattern, patlen))
-			continue;
-		if (namelen != patlen && name[namelen - patlen - 1] != '/')
+ if (!ref_abbrev_matches_full_with_rules(pattern, name, ref_rev_parse_rules))
 			continue;

I vaguely recall that in the old round this check used to be
without negation '!' in the front.  I think this version is
correct.

Yes. I started with a syntax inspired by strcmp. But later
the function got match in its name. I think returning a
match with 'true' is more natural; and reserving '-1, 0, 1'
for compare (as in strcmp). Therefore I changed the return
value.

With '!' is correct now. Without '!' was correct before.

	Steffen

-
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