fetcher git: Drop HTTP support
This commit is contained in:
parent
5362b77c06
commit
a77283d9c1
|
@ -47,44 +47,20 @@ namespace Sparkles.Git {
|
||||||
public GitFetcher (SparkleFetcherInfo fetcher_info, SSHAuthenticationInfo auth_info) : base (fetcher_info)
|
public GitFetcher (SparkleFetcherInfo fetcher_info, SSHAuthenticationInfo auth_info) : base (fetcher_info)
|
||||||
{
|
{
|
||||||
this.auth_info = auth_info;
|
this.auth_info = auth_info;
|
||||||
|
var uri_builder = new UriBuilder (RemoteUrl);
|
||||||
|
|
||||||
if (RemoteUrl.ToString ().StartsWith ("ssh+"))
|
if (!RemoteUrl.Scheme.Equals ("ssh") && !RemoteUrl.Scheme.Equals ("git"))
|
||||||
RemoteUrl = new Uri ("ssh" + RemoteUrl.ToString ().Substring (RemoteUrl.ToString ().IndexOf ("://")));
|
uri_builder.Scheme = "ssh";
|
||||||
|
|
||||||
Uri uri = RemoteUrl;
|
if (RemoteUrl.Host.Equals ("github.com")) {
|
||||||
|
uri_builder.Scheme = "ssh";
|
||||||
|
uri_builder.UserName = "git";
|
||||||
|
|
||||||
if (!uri.Scheme.Equals ("ssh") && !uri.Scheme.Equals ("https") &&
|
} else if (string.IsNullOrEmpty (RemoteUrl.UserInfo)) {
|
||||||
!uri.Scheme.Equals ("http") && !uri.Scheme.Equals ("git")) {
|
uri_builder.UserName = "storage";
|
||||||
|
|
||||||
uri = new Uri ("ssh://" + uri);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uri.Host.Equals ("gitorious.org") && !uri.Scheme.StartsWith ("http")) {
|
RemoteUrl = uri_builder.Uri;
|
||||||
if (!uri.AbsolutePath.Equals ("/") &&
|
|
||||||
!uri.AbsolutePath.EndsWith (".git")) {
|
|
||||||
|
|
||||||
uri = new Uri ("ssh://git@gitorious.org" + uri.AbsolutePath + ".git");
|
|
||||||
|
|
||||||
} else {
|
|
||||||
uri = new Uri ("ssh://git@gitorious.org" + uri.AbsolutePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (uri.Host.Equals ("github.com") && !uri.Scheme.StartsWith ("http")) {
|
|
||||||
uri = new Uri ("ssh://git@github.com" + uri.AbsolutePath);
|
|
||||||
|
|
||||||
} else if (uri.Host.Equals ("bitbucket.org") && !uri.Scheme.StartsWith ("http")) {
|
|
||||||
// Nothing really
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (string.IsNullOrEmpty (uri.UserInfo) && !uri.Scheme.StartsWith ("http")) {
|
|
||||||
if (uri.Port == -1)
|
|
||||||
uri = new Uri (uri.Scheme + "://storage@" + uri.Host + uri.AbsolutePath);
|
|
||||||
else
|
|
||||||
uri = new Uri (uri.Scheme + "://storage@" + uri.Host + ":" + uri.Port + uri.AbsolutePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoteUrl = uri;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue