mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
enhance: new regex for tag name (#290)
* `(?!\.)` should not starts with `.` * `(?!/)` should not starts with `/` * `(?!.*\.$)` should not end with `.` * `(?!.*/$)` should not end with '/` * `(?!.*\.\.)` should not contains `..`
This commit is contained in:
parent
7a3a4070a3
commit
29ce95e81e
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ namespace SourceGit.ViewModels
|
||||||
}
|
}
|
||||||
|
|
||||||
[Required(ErrorMessage = "Tag name is required!")]
|
[Required(ErrorMessage = "Tag name is required!")]
|
||||||
[RegularExpression(@"^[^/]{1}[\w\-\./]*$", ErrorMessage = "Bad tag name format!")]
|
[RegularExpression(@"^(?!\.)(?!/)(?!.*\.$)(?!.*/$)(?!.*\.\.)[\w\-\./]+$", ErrorMessage = "Bad tag name format!")]
|
||||||
[CustomValidation(typeof(CreateTag), nameof(ValidateTagName))]
|
[CustomValidation(typeof(CreateTag), nameof(ValidateTagName))]
|
||||||
public string TagName
|
public string TagName
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue