Skip to content

Commit 461d714

Browse files
author
A-Ovchinnikov-mx
authored
Enable basic proxy support in libgit2 (#11)
1 parent 71e556f commit 461d714

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

LibGit2Sharp/Commands/Fetch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static void Fetch(Repository repository, string remote, IEnumerable<strin
7575
fetchOptions.CustomHeaders = GitStrArrayManaged.BuildFrom(options.CustomHeaders);
7676
}
7777

78-
fetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 };
78+
fetchOptions.ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
7979

8080
Proxy.git_remote_fetch(remoteHandle, refspecs, fetchOptions, logMessage);
8181
}

LibGit2Sharp/Network.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ private IEnumerable<Reference> ListReferencesInternal(string url, CredentialsHan
118118
using (RemoteHandle remoteHandle = BuildRemoteHandle(repository.Handle, url))
119119
{
120120
GitRemoteCallbacks gitCallbacks = new GitRemoteCallbacks { version = 1 };
121-
GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1 };
121+
GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
122122

123123
if (credentialsProvider != null)
124124
{
@@ -375,7 +375,7 @@ public virtual void Push(Remote remote, IEnumerable<string> pushRefSpecs, PushOp
375375
{
376376
PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism,
377377
RemoteCallbacks = gitCallbacks,
378-
ProxyOptions = new GitProxyOptions { Version = 1 },
378+
ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto },
379379
});
380380
}
381381
}

LibGit2Sharp/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ private static RemoteHandle ConnectToAnonymousRemote(RepositoryHandle repository
720720
RemoteHandle remoteHandle = Proxy.git_remote_create_anonymous(repositoryHandle, url);
721721

722722
var gitCallbacks = new GitRemoteCallbacks { version = 1 };
723-
var proxyOptions = new GitProxyOptions { Version = 1 };
723+
var proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
724724

725725
if (credentialsProvider != null)
726726
{
@@ -810,7 +810,7 @@ public static string Clone(string sourceUrl, string workdirPath,
810810
var gitCheckoutOptions = checkoutOptionsWrapper.Options;
811811

812812
var gitFetchOptions = fetchOptionsWrapper.Options;
813-
gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 };
813+
gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
814814
gitFetchOptions.RemoteCallbacks = new RemoteCallbacks(options).GenerateCallbacks();
815815
if (options.FetchOptions != null && options.FetchOptions.CustomHeaders != null)
816816
{

LibGit2Sharp/SubmoduleCollection.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ public virtual void Update(string name, SubmoduleUpdateOptions options)
104104
{
105105
Version = 1,
106106
CheckoutOptions = gitCheckoutOptions,
107-
FetchOptions = new GitFetchOptions { ProxyOptions = new GitProxyOptions { Version = 1 }, RemoteCallbacks = gitRemoteCallbacks },
107+
FetchOptions = new GitFetchOptions
108+
{
109+
ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto },
110+
RemoteCallbacks = gitRemoteCallbacks
111+
},
108112
CloneCheckoutStrategy = CheckoutStrategy.GIT_CHECKOUT_SAFE
109113
};
110114

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "1.110.10",
3+
"version": "1.110.11",
44
"cloudBuild": {
55
"buildNumber": {
66
"enabled": true

0 commit comments

Comments
 (0)