@@ -18,17 +18,14 @@ abstract class MantisSourceGitBasePlugin extends MantisSourcePlugin
1818 * Git branch name validation regex.
1919 * Based on rules defined in man page
2020 * http://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
21+ * - Must not start with '/'; cannot contain '/.', '//', '@{' or '\';
22+ * cannot be a single '@': `^(?!/|.*([/.]\.|//|@\{|\\\\)|@$)`
23+ * - One or more chars, except the following: ASCII control, space,
24+ * tilde, caret, colon, question mark, asterisk, open bracket:
25+ * `[^\000-\037\177 ~^:?*[]+`
26+ * - Must not end with '.lock', '/' or '.': `(?<!\.lock|[/.])$`
2127 */
22- private $ valid_branch_regex = '% '
23- # Must not start with '/'; cannot contain '/.', '//', '@{' or '\';
24- # cannot be a single '@'.
25- . '^(?!/|.*([/.]\.|//|@\{| \\\\)|@$) '
26- # One or more chars, except the following: ASCII control, space,
27- # tilde, caret, colon, question mark, asterisk, open bracket.
28- . '[^\000-\037\177 ~^:?*[]+ '
29- # Must not end with '.lock', '/' or '.'
30- . '(?<!\.lock|[/.])$ '
31- . '% ' ;
28+ private $ valid_branch_regex = '%^(?!/|.*([/.]\.|//|@\{| \\\\)|@$)[^\000-\037\177 ~^:?*[]+(?<!\.lock|[/.])$% ' ;
3229
3330 /**
3431 * Error constants
0 commit comments