From d15e27f6649cc3708dea802fbd6f8aa4f5b40d20 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Fri, 2 Oct 2015 16:37:11 +0200 Subject: [PATCH 1/3] Fix compilation warnings --- LibGit2Sharp/Core/Proxy.cs | 4 ++-- LibGit2Sharp/GlobalSettings.cs | 1 - LibGit2Sharp/IDiffResult.cs | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index 2ae5d0800..0567c79bb 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -3216,7 +3216,7 @@ private enum LibGitOption /// /// The level (global/system/XDG) of the config. /// - /// The paths delimited by 'GIT_PATH_LIST_SEPARATOR' (). + /// The paths delimited by 'GIT_PATH_LIST_SEPARATOR'. /// public static string git_libgit2_opts_get_search_path(ConfigurationLevel level) { @@ -3238,7 +3238,7 @@ public static string git_libgit2_opts_get_search_path(ConfigurationLevel level) /// /// The level (global/system/XDG) of the config. /// - /// A string of paths delimited by 'GIT_PATH_LIST_SEPARATOR' (). + /// A string of paths delimited by 'GIT_PATH_LIST_SEPARATOR'. /// Pass null to reset the search path to the default. /// public static void git_libgit2_opts_set_search_path(ConfigurationLevel level, string path) diff --git a/LibGit2Sharp/GlobalSettings.cs b/LibGit2Sharp/GlobalSettings.cs index b3ec3cac8..1a52089d7 100644 --- a/LibGit2Sharp/GlobalSettings.cs +++ b/LibGit2Sharp/GlobalSettings.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Reflection; -using System.Collections.Generic; using LibGit2Sharp.Core; namespace LibGit2Sharp diff --git a/LibGit2Sharp/IDiffResult.cs b/LibGit2Sharp/IDiffResult.cs index fdd4a5c8f..d16af711d 100644 --- a/LibGit2Sharp/IDiffResult.cs +++ b/LibGit2Sharp/IDiffResult.cs @@ -1,5 +1,8 @@ namespace LibGit2Sharp { + /// + /// Marker interface to identify Diff results. + /// public interface IDiffResult { } } From 6bc517f4d8103578e309ec7d8e206b6d9c6b2b3e Mon Sep 17 00:00:00 2001 From: nulltoken Date: Fri, 2 Oct 2015 16:40:14 +0200 Subject: [PATCH 2/3] Update libgit2 to a99f33e https://github.com/libgit2/libgit2/compare/6b36945...a99f33e --- LibGit2Sharp/Core/GitFetchOptions.cs | 1 + LibGit2Sharp/Core/NativeMethods.cs | 3 ++- LibGit2Sharp/Core/Proxy.cs | 13 +++++++++++-- LibGit2Sharp/LibGit2Sharp.csproj | 4 ++-- LibGit2Sharp/packages.config | 4 ++-- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/LibGit2Sharp/Core/GitFetchOptions.cs b/LibGit2Sharp/Core/GitFetchOptions.cs index 02f996dff..7b284bf51 100644 --- a/LibGit2Sharp/Core/GitFetchOptions.cs +++ b/LibGit2Sharp/Core/GitFetchOptions.cs @@ -10,5 +10,6 @@ internal class GitFetchOptions public FetchPruneStrategy Prune; public bool UpdateFetchHead = true; public TagFetchMode download_tags; + public GitStrArrayManaged custom_headers; } } diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index 7648b8f9e..718fe1487 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -1098,7 +1098,8 @@ internal static extern string git_refspec_src( internal static extern int git_remote_connect( RemoteSafeHandle remote, GitDirection direction, - ref GitRemoteCallbacks callbacks); + ref GitRemoteCallbacks callbacks, + ref GitStrArray custom_headers); [DllImport(libgit2)] internal static extern int git_remote_create( diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index 0567c79bb..141979721 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -1997,8 +1997,17 @@ public static RemoteSafeHandle git_remote_create_anonymous(RepositorySafeHandle public static void git_remote_connect(RemoteSafeHandle remote, GitDirection direction, ref GitRemoteCallbacks remoteCallbacks) { - int res = NativeMethods.git_remote_connect(remote, direction, ref remoteCallbacks); - Ensure.ZeroResult(res); + GitStrArrayManaged customHeaders = new GitStrArrayManaged(); + + try + { + int res = NativeMethods.git_remote_connect(remote, direction, ref remoteCallbacks, ref customHeaders.Array); + Ensure.ZeroResult(res); + } + catch (Exception) + { + customHeaders.Dispose(); + } } public static void git_remote_delete(RepositorySafeHandle repo, string name) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index 561ad7676..3fc9f59b5 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -403,7 +403,7 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - +