From 9ddca3184dd9d45864d19448b829bb055d98ec09 Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Mon, 4 May 2015 17:00:09 +0300 Subject: Remove manual connection to remote As seen in https://github.com/libgit2/libgit2/blob/master/src/remote.c#L2381-L2397 --- LibGit2Sharp/Core/NativeMethods.cs | 3 --- LibGit2Sharp/Core/Proxy.cs | 8 -------- LibGit2Sharp/Network.cs | 18 +++++------------- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/LibGit2Sharp/Core/NativeMethods.cs b/LibGit2Sharp/Core/NativeMethods.cs index b71d4708..a9453529 100644 --- a/LibGit2Sharp/Core/NativeMethods.cs +++ b/LibGit2Sharp/Core/NativeMethods.cs @@ -1026,9 +1026,6 @@ namespace LibGit2Sharp.Core RepositorySafeHandle repo, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name); - [DllImport(libgit2)] - internal static extern void git_remote_disconnect(RemoteSafeHandle remote); - [DllImport(libgit2)] internal static extern int git_remote_fetch( RemoteSafeHandle remote, diff --git a/LibGit2Sharp/Core/Proxy.cs b/LibGit2Sharp/Core/Proxy.cs index a7b4d6ef..68888cae 100644 --- a/LibGit2Sharp/Core/Proxy.cs +++ b/LibGit2Sharp/Core/Proxy.cs @@ -2032,14 +2032,6 @@ namespace LibGit2Sharp.Core } } - public static void git_remote_disconnect(RemoteSafeHandle remote) - { - using (ThreadAffinity()) - { - NativeMethods.git_remote_disconnect(remote); - } - } - public static GitRefSpecHandle git_remote_get_refspec(RemoteSafeHandle remote, int n) { return NativeMethods.git_remote_get_refspec(remote, (UIntPtr)n); diff --git a/LibGit2Sharp/Network.cs b/LibGit2Sharp/Network.cs index 49d80d3d..38e174aa 100644 --- a/LibGit2Sharp/Network.cs +++ b/LibGit2Sharp/Network.cs @@ -248,19 +248,11 @@ namespace LibGit2Sharp GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks(); Proxy.git_remote_set_callbacks(remoteHandle, ref gitCallbacks); - try - { - Proxy.git_remote_connect(remoteHandle, GitDirection.Push); - Proxy.git_remote_push(remoteHandle, pushRefSpecs, - new GitPushOptions() - { - PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism - }); - } - finally - { - Proxy.git_remote_disconnect(remoteHandle); - } + Proxy.git_remote_push(remoteHandle, pushRefSpecs, + new GitPushOptions() + { + PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism + }); } } -- cgit v1.2.3