fix<GitURL>: allow '.' in repository name. see issue #14

This commit is contained in:
leo 2023-10-09 17:31:11 +08:00
parent 0585574d87
commit 80aa468b08

View file

@ -6,9 +6,9 @@ namespace SourceGit.Views.Validations {
public class GitURL : ValidationRule { public class GitURL : ValidationRule {
private static readonly Regex[] VALID_FORMATS = new Regex[] { private static readonly Regex[] VALID_FORMATS = new Regex[] {
new Regex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), new Regex(@"^http[s]?://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-\.]+\.git$"),
new Regex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-]+/[\w\-]+\.git$"), new Regex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-]+/[\w\-\.]+\.git$"),
new Regex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), new Regex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-\.]+\.git$"),
}; };
public static bool IsSSH(string url) { public static bool IsSSH(string url) {