allow the : to seprate repo name from domain in addresses

This commit is contained in:
Hylke Bons 2010-05-27 10:58:30 +02:00
parent 920029e627
commit c0450a5112
2 changed files with 13 additions and 3 deletions

View file

@ -120,8 +120,18 @@ namespace SparkleShare {
public void CloneRepo (object o, EventArgs args) {
string RepoRemoteUrl = RemoteUrlCombo.Entry.Text;
string RepoName =
RepoRemoteUrl.Substring (RepoRemoteUrl.LastIndexOf ("/") + 1);
// Check wheter a "/" or ":" is used to separate the
// repo name from the domain.
int SlashPos = RepoRemoteUrl.LastIndexOf ("/");
int ColumnPos = RepoRemoteUrl.LastIndexOf (":");
string RepoName;
if (SlashPos > ColumnPos)
RepoName = RepoRemoteUrl.Substring (SlashPos + 1);
else
RepoName = RepoRemoteUrl.Substring (ColumnPos + 1);
Process Process = new Process();
Process.EnableRaisingEvents = true;

View file

@ -100,7 +100,7 @@ namespace SparkleShare {
}
public static bool IsGitUrl (string Url) {
return Regex.Match (Url, @"[a-z]+://(.)+/(.)+").Success;
return Regex.Match (Url, @"[a-z]+://(.)+(/|:)(.)+").Success;
}
}