Skip to content

Commit e6261a1

Browse files
Making proxy change in GitProxyOptions struct instead of other classes
1 parent 8f1868c commit e6261a1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
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, Type = GitProxyType.Auto };
78+
fetchOptions.ProxyOptions = new GitProxyOptions { Version = 1};
7979

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

LibGit2Sharp/Core/GitProxyOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal enum GitProxyType
1414
internal struct GitProxyOptions
1515
{
1616
public uint Version;
17-
public GitProxyType Type;
17+
public GitProxyType Type= GitProxyType.Auto;
1818
public IntPtr Url;
1919
public IntPtr CredentialsCb;
2020
public IntPtr CertificateCheck;

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, Type = GitProxyType.Auto };
121+
GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1 };
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, Type = GitProxyType.Auto },
378+
ProxyOptions = new GitProxyOptions { Version = 1 },
379379
});
380380
}
381381
}

LibGit2Sharp/Repository.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ public static IEnumerable<Reference> ListRemoteReferences(string url, Credential
678678
using (RemoteHandle remoteHandle = Proxy.git_remote_create_anonymous(repositoryHandle, url))
679679
{
680680
var gitCallbacks = new GitRemoteCallbacks { version = 1 };
681-
var proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
681+
var proxyOptions = new GitProxyOptions { Version = 1 };
682682

683683
if (credentialsProvider != null)
684684
{
@@ -768,7 +768,7 @@ public static string Clone(string sourceUrl, string workdirPath,
768768
var gitCheckoutOptions = checkoutOptionsWrapper.Options;
769769

770770
var gitFetchOptions = fetchOptionsWrapper.Options;
771-
gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto };
771+
gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 };
772772
gitFetchOptions.RemoteCallbacks = new RemoteCallbacks(options).GenerateCallbacks();
773773
if (options.FetchOptions != null && options.FetchOptions.CustomHeaders != null)
774774
{

0 commit comments

Comments
 (0)