Add restriction for single characters in branch name

This commit is contained in:
Douglas Barbosa Alexandre 2015-12-17 19:45:11 -02:00
parent e26d1b4757
commit 05737f6c85
1 changed files with 8 additions and 2 deletions

View File

@ -34,13 +34,19 @@ class @NewBranchForm
conjunction: "or" conjunction: "or"
} }
characters = { invalid = {
pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g pattern: /(\s|~|\^|:|\?|\*|\[|\\|\.\.|@\{|\/{2,}){1}/g
prefix: "can't contains", prefix: "can't contains",
conjunction: ", " conjunction: ", "
} }
@restrictions = [startsWith, characters, endsWith] single = {
pattern: /^@+$/g
prefix: "can't be",
conjunction: "or"
}
@restrictions = [startsWith, invalid, endsWith, single]
validate: => validate: =>
@branchNameError.empty() @branchNameError.empty()