mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix<SubmodulePathRequiredRule>: relative path for submodule is optional.
This commit is contained in:
parent
344a603665
commit
29658a7966
1 changed files with 4 additions and 2 deletions
|
@ -130,9 +130,11 @@ namespace SourceGit.Helpers {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SubmodulePathRequiredRule : ValidationRule {
|
public class SubmodulePathRequiredRule : ValidationRule {
|
||||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||||
var regex = new Regex(@"^[\w\-\._/]+$");
|
|
||||||
var path = value as string;
|
var path = value as string;
|
||||||
var succ = !string.IsNullOrEmpty(path) && regex.IsMatch(path.Trim());
|
if (string.IsNullOrEmpty(path)) return ValidationResult.ValidResult;
|
||||||
|
|
||||||
|
var regex = new Regex(@"^[\w\-\._/]+$");
|
||||||
|
var succ = regex.IsMatch(path.Trim());
|
||||||
return !succ ? new ValidationResult(false, App.Text("BadSubmodulePath")) : ValidationResult.ValidResult;
|
return !succ ? new ValidationResult(false, App.Text("BadSubmodulePath")) : ValidationResult.ValidResult;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue