Add restriction for single characters in branch name
This commit is contained in:
parent
e26d1b4757
commit
05737f6c85
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue