diff --git a/SparkleShare/SparkleDialog.cs b/SparkleShare/SparkleDialog.cs index 2d22495d..39c9e006 100644 --- a/SparkleShare/SparkleDialog.cs +++ b/SparkleShare/SparkleDialog.cs @@ -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; diff --git a/SparkleShare/SparkleHelpers.cs b/SparkleShare/SparkleHelpers.cs index f15b92aa..4f4eda57 100644 --- a/SparkleShare/SparkleHelpers.cs +++ b/SparkleShare/SparkleHelpers.cs @@ -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; } }