From 5e56224a6892ce50cbf181f3c7065d3694528082 Mon Sep 17 00:00:00 2001 From: MikeTV Date: Sat, 1 Oct 2016 15:27:32 -0500 Subject: [PATCH 1/3] Enabling libgit2's proxy support --- LibGit2Sharp/Commands/Fetch.cs | 2 +- LibGit2Sharp/Network.cs | 4 ++-- LibGit2Sharp/Repository.cs | 4 ++-- LibGit2Sharp/SubmoduleCollection.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LibGit2Sharp/Commands/Fetch.cs b/LibGit2Sharp/Commands/Fetch.cs index ed8ca66c0..3d8af38af 100644 --- a/LibGit2Sharp/Commands/Fetch.cs +++ b/LibGit2Sharp/Commands/Fetch.cs @@ -71,7 +71,7 @@ public static void Fetch(Repository repository, string remote, IEnumerable ListReferencesInternal(string url, CredentialsHan using (RemoteHandle remoteHandle = BuildRemoteHandle(repository.Handle, url)) { GitRemoteCallbacks gitCallbacks = new GitRemoteCallbacks { version = 1 }; - GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1 }; + GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }; if (credentialsProvider != null) { @@ -470,7 +470,7 @@ public virtual void Push(Remote remote, IEnumerable pushRefSpecs, PushOp { PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism, RemoteCallbacks = gitCallbacks, - ProxyOptions = new GitProxyOptions { Version = 1 }, + ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }, }); } } diff --git a/LibGit2Sharp/Repository.cs b/LibGit2Sharp/Repository.cs index 7c4f2f1de..e817d8b23 100644 --- a/LibGit2Sharp/Repository.cs +++ b/LibGit2Sharp/Repository.cs @@ -636,7 +636,7 @@ public static IEnumerable ListRemoteReferences(string url, Credential using (RemoteHandle remoteHandle = Proxy.git_remote_create_anonymous(repositoryHandle, url)) { var gitCallbacks = new GitRemoteCallbacks { version = 1 }; - var proxyOptions = new GitProxyOptions { Version = 1 }; + var proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }; if (credentialsProvider != null) { @@ -727,7 +727,7 @@ public static string Clone(string sourceUrl, string workdirPath, var remoteCallbacks = new RemoteCallbacks(options); var gitRemoteCallbacks = remoteCallbacks.GenerateCallbacks(); - var gitProxyOptions = new GitProxyOptions { Version = 1 }; + var gitProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }; var cloneOpts = new GitCloneOptions { diff --git a/LibGit2Sharp/SubmoduleCollection.cs b/LibGit2Sharp/SubmoduleCollection.cs index fc508107a..c1c50261b 100644 --- a/LibGit2Sharp/SubmoduleCollection.cs +++ b/LibGit2Sharp/SubmoduleCollection.cs @@ -104,7 +104,7 @@ public virtual void Update(string name, SubmoduleUpdateOptions options) { Version = 1, CheckoutOptions = gitCheckoutOptions, - FetchOptions = new GitFetchOptions { ProxyOptions = new GitProxyOptions { Version = 1 }, RemoteCallbacks = gitRemoteCallbacks }, + FetchOptions = new GitFetchOptions { ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }, RemoteCallbacks = gitRemoteCallbacks }, CloneCheckoutStrategy = CheckoutStrategy.GIT_CHECKOUT_SAFE }; From 7304a8691c181232ccbf68d76fe9423561494bb4 Mon Sep 17 00:00:00 2001 From: MikeTV Date: Thu, 28 Mar 2019 12:49:00 -0500 Subject: [PATCH 2/3] Reenable git proxy support --- LibGit2Sharp/Commands/Fetch.cs | 2 +- LibGit2Sharp/Repository.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LibGit2Sharp/Commands/Fetch.cs b/LibGit2Sharp/Commands/Fetch.cs index d61fca5a5..eda0a671d 100644 --- a/LibGit2Sharp/Commands/Fetch.cs +++ b/LibGit2Sharp/Commands/Fetch.cs @@ -75,7 +75,7 @@ public static void Fetch(Repository repository, string remote, IEnumerable ListRemoteReferences(string url, Credential using (RemoteHandle remoteHandle = Proxy.git_remote_create_anonymous(repositoryHandle, url)) { var gitCallbacks = new GitRemoteCallbacks { version = 1 }; - var proxyOptions = new GitProxyOptions { Version = 1 }; + var proxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }; if (credentialsProvider != null) { @@ -768,7 +768,7 @@ public static string Clone(string sourceUrl, string workdirPath, var gitCheckoutOptions = checkoutOptionsWrapper.Options; var gitFetchOptions = fetchOptionsWrapper.Options; - gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 }; + gitFetchOptions.ProxyOptions = new GitProxyOptions { Version = 1, Type = GitProxyType.Auto }; gitFetchOptions.RemoteCallbacks = new RemoteCallbacks(options).GenerateCallbacks(); if (options.FetchOptions != null && options.FetchOptions.CustomHeaders != null) { From d99ff44832e70271379b110316d80e54aff510c8 Mon Sep 17 00:00:00 2001 From: MikeTV <9100146+MikeTV@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:22:05 -0500 Subject: [PATCH 3/3] Use AlphaFS to support long file names in this layer --- LibGit2Sharp/LibGit2Sharp.csproj | 1 + LibGit2Sharp/RepositoryExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 4c35a6cea..9d97d1c13 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -29,6 +29,7 @@ + diff --git a/LibGit2Sharp/RepositoryExtensions.cs b/LibGit2Sharp/RepositoryExtensions.cs index edeb6b93f..e73f90e80 100644 --- a/LibGit2Sharp/RepositoryExtensions.cs +++ b/LibGit2Sharp/RepositoryExtensions.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; -using System.IO; +using Alphaleonis.Win32.Filesystem; using System.Linq; using LibGit2Sharp.Core;