@@ -18,17 +18,14 @@ abstract class MantisSourceGitBasePlugin extends MantisSourcePlugin
18
18
* Git branch name validation regex.
19
19
* Based on rules defined in man page
20
20
* 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|[/.])$`
21
27
*/
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|[/.])$% ' ;
32
29
33
30
/**
34
31
* Error constants
0 commit comments