From 08fbdb30438fd7087c5abe15840a22fe21094515 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Sat, 7 Mar 2009 01:11:36 -0500 Subject: Keep '*' in pattern refspecs In order to do anything more capable with refspecs, the first step is to keep the entire input. Additionally, validate patterns by checking for the ref matching the rules for a pattern as given by check_ref_format(). This requires a slight change to check_ref_format() to make it enforce the requirement that the '*' immediately follow a '/'. Signed-off-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- refs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'refs.c') diff --git a/refs.c b/refs.c index 6eb5f53846..a50ba79270 100644 --- a/refs.c +++ b/refs.c @@ -718,9 +718,7 @@ int check_ref_format(const char *ref) while ((ch = *cp++) != 0) { bad_type = bad_ref_char(ch); if (bad_type) { - return (bad_type == 2 && !*cp) - ? CHECK_REF_FORMAT_WILDCARD - : CHECK_REF_FORMAT_ERROR; + return CHECK_REF_FORMAT_ERROR; } if (ch == '/') break; -- cgit v1.2.1