From 3eb29e17fc6a1fe6b79c31192e09d8d084f4def8 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sat, 12 Dec 2009 09:51:29 +0530 Subject: [PATCH] allow @ in repo names and patterns stuff like "repo foo/CREATER/.+" means the reponame has to be a superset of the username in terms of allowed characters --- src/gitolite.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index 1ce0480..56336de 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -24,11 +24,13 @@ $WARN = "\n\t\t***** WARNING *****\n "; $R_COMMANDS=qr/^(git[ -]upload-pack|git[ -]upload-archive)$/; $W_COMMANDS=qr/^git[ -]receive-pack$/; -# note that REPONAME_PATT allows "/", while USERNAME_PATT allows "@" -$REPONAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._/-]*$); # very simple pattern +# note that REPONAME_PATT allows "/", while USERNAME_PATT does not +# also, the reason REPONAME_PATT is a superset of USERNAME_PATT is (duh!) +# because in this version, a repo can have "CREATER" in the name (see docs) +$REPONAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@/-]*$); # very simple pattern $USERNAME_PATT=qr(^\@?[0-9a-zA-Z][0-9a-zA-Z._\@-]*$); # very simple pattern # same as REPONAME, plus some common regex metas -$REPOPATT_PATT=qr(^\@?[0-9a-zA-Z][\\^.$|()[\]*+?{}0-9a-zA-Z._/-]*$); +$REPOPATT_PATT=qr(^\@?[0-9a-zA-Z][\\^.$|()[\]*+?{}0-9a-zA-Z._\@/-]*$); # ---------------------------------------------------------------------------- # convenience subs