From c091b3d415f95d3e4e62acddb084e211af46acbf Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Mon, 17 Mar 2008 22:05:23 -0400 Subject: Tighten refspec processing This changes the pattern matching code to not store the required final / before the *, and then to require each side to be a valid ref (or empty). In particular, any refspec that looks like it should be a pattern but doesn't quite meet the requirements will be found to be invalid as a fallback non-pattern. This was cherry picked from commit ef00d15 (Tighten refspec processing, 2008-03-17), and two fix-up commits 46220ca (remote.c: Fix overtight refspec validation, 2008-03-20) and 7d19da4 (refspec: allow colon-less wildcard "refs/category/*", 2008-03-25) squashed in. Signed-off-by: Daniel Barkalow Signed-off-by: Junio C Hamano --- remote.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'remote.h') diff --git a/remote.h b/remote.h index 86e036d610..6b8c32cc7b 100644 --- a/remote.h +++ b/remote.h @@ -63,7 +63,8 @@ void free_refs(struct ref *ref); */ void ref_remove_duplicates(struct ref *ref_map); -struct refspec *parse_ref_spec(int nr_refspec, const char **refspec); +struct refspec *parse_fetch_refspec(int nr_refspec, const char **refspec); +struct refspec *parse_push_refspec(int nr_refspec, const char **refspec); int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail, int nr_refspec, const char **refspec, int all); -- cgit v1.3