Fix check for schema and file suffix
String.Substring() doesn't accept values < 0. Also replace substring matching with StartsWith() and EndsWith() to avoid some problems.
This commit is contained in:
parent
09ce4fb9ee
commit
84e7b1ae6d
|
@ -95,12 +95,12 @@ namespace SparkleShare {
|
|||
// to ssh://git@gitorious.org/sparkleshare
|
||||
public static string SparkleToGitUrl (string Url)
|
||||
{
|
||||
if (Url.Substring (0, 10).Equals ("sparkle://"))
|
||||
if (Url.StartsWith ("sparkle://"))
|
||||
Url = Url.Replace ("sparkle://", "ssh://git@");
|
||||
|
||||
// Usually don't need the ".git" at the end.
|
||||
// It looks ugly as a folder too.
|
||||
if (Url.Substring (-4).Equals (".git"))
|
||||
if (Url.EndsWith (".git"))
|
||||
Url = Url.Substring (0, Url.Length - 4);
|
||||
|
||||
return Url;
|
||||
|
|
Loading…
Reference in a new issue