From 7c502e9b203d3a976b36000a6d8b4d9261c72233 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Thu, 26 Apr 2012 14:58:05 +0200 Subject: [PATCH] fetcher git: accept HTTP(S) addresses --- SparkleLib/Git/SparkleFetcherGit.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/SparkleLib/Git/SparkleFetcherGit.cs b/SparkleLib/Git/SparkleFetcherGit.cs index 50e50635..8e4d3478 100755 --- a/SparkleLib/Git/SparkleFetcherGit.cs +++ b/SparkleLib/Git/SparkleFetcherGit.cs @@ -38,6 +38,8 @@ namespace SparkleLib.Git { Uri uri = RemoteUrl; if (!uri.Scheme.Equals ("ssh") && + !uri.Scheme.Equals ("https") && + !uri.Scheme.Equals ("http") && !uri.Scheme.Equals ("git")) { uri = new Uri ("ssh://" + uri); @@ -61,11 +63,16 @@ namespace SparkleLib.Git { uri = new Uri ("ssh://git@gnome.org/git" + uri.AbsolutePath); } else { - if (string.IsNullOrEmpty (uri.UserInfo)) { - if (uri.Port == -1) + if (string.IsNullOrEmpty (uri.UserInfo) && + !uri.Scheme.Equals ("https") && + !uri.Scheme.Equals ("http")) { + + if (uri.Port == -1) { uri = new Uri (uri.Scheme + "://git@" + uri.Host + uri.AbsolutePath); - else + + } else { uri = new Uri (uri.Scheme + "://git@" + uri.Host + ":" + uri.Port + uri.AbsolutePath); + } } }