mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34:59 +00:00
feature(Submodule): supports git submodule
This commit is contained in:
parent
789231fdc4
commit
0132fc496b
8 changed files with 359 additions and 13 deletions
|
@ -121,4 +121,16 @@ namespace SourceGit.Helpers {
|
|||
return !succ ? new ValidationResult(false, "Invalid path for patch file") : ValidationResult.ValidResult;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Required for submodule path.
|
||||
/// </summary>
|
||||
public class SubmodulePathRequiredRule : ValidationRule {
|
||||
public override ValidationResult Validate(object value, CultureInfo cultureInfo) {
|
||||
var regex = new Regex(@"^[\w\-\._/]+$");
|
||||
var path = value as string;
|
||||
var succ = !string.IsNullOrEmpty(path) && regex.IsMatch(path.Trim());
|
||||
return !succ ? new ValidationResult(false, "Invalid path for submodules") : ValidationResult.ValidResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue