push: use same rules as git-rev-parse to resolve refspecs
[gitweb.git] / remote.c
index bec2ba1adbed02af54572be924dcfbb47bf9c423..4085c517e4de40474738794ce3c5d0dc1901134d 100644 (file)
--- 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 (!refname_match(pattern, name, ref_rev_parse_rules))
                        continue;
 
                /* A match is "weak" if it is with refs outside