我使用libgit2sharp-ssh
并且成功实现了ssh连接,但是现在https/http
连接在代理下不起作用?
我看一下libgit2sharp-ssh
lib中的clone和Push方法的实现,它们两个ProxyOptions
的值是:
ProxyOptions = new GitProxyOptions { Version = 1 }
public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOptions pushOptions)
{
Ensure.ArgumentNotNull(remote, "remote");
Ensure.ArgumentNotNull(pushRefSpecs, "pushRefSpecs");
// Return early if there is nothing to push.
if (!pushRefSpecs.Any())
{
return;
}
if (pushOptions == null)
{
pushOptions = new PushOptions();
}
// Load the remote.
using (RemoteHandle remoteHandle = Proxy.git_remote_lookup(repository.Handle, remote.Name, true))
{
var callbacks = new RemoteCallbacks(pushOptions);
GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks();
Proxy.git_remote_push(remoteHandle,
pushRefSpecs,
new GitPushOptions()
{
PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism,
RemoteCallbacks = gitCallbacks,
ProxyOptions = new GitProxyOptions { Version = 1 },
});
}
}
internal enum GitProxyType
{
None,
Auto,
Specified
}
[StructLayout(LayoutKind.Sequential)]
internal struct GitProxyOptions
{
public uint Version;
public GitProxyType Type;
public IntPtr Url;
public IntPtr CredentialsCb;
public IntPtr CertificateCheck;
public IntPtr CbPayload;
}
}
在将libgit2sharp-ssh
连接到git时,http/s
不支持使用代理吗? (因为与libgit2sharp一起使用时,没有很好地与代理一起执行ssh)