Skip to content

Commit 659be88

Browse files
committed
Merge pull request #1038 from libgit2/Therzok-remove-forced-connection
Remove manual connection to remote
2 parents 645d89e + 9ddca31 commit 659be88

File tree

3 files changed

+5
-24
lines changed

3 files changed

+5
-24
lines changed

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,9 +1026,6 @@ internal static extern int git_remote_delete(
10261026
RepositorySafeHandle repo,
10271027
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string name);
10281028

1029-
[DllImport(libgit2)]
1030-
internal static extern void git_remote_disconnect(RemoteSafeHandle remote);
1031-
10321029
[DllImport(libgit2)]
10331030
internal static extern int git_remote_fetch(
10341031
RemoteSafeHandle remote,

LibGit2Sharp/Core/Proxy.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,14 +2032,6 @@ public static void git_remote_delete(RepositorySafeHandle repo, string name)
20322032
}
20332033
}
20342034

2035-
public static void git_remote_disconnect(RemoteSafeHandle remote)
2036-
{
2037-
using (ThreadAffinity())
2038-
{
2039-
NativeMethods.git_remote_disconnect(remote);
2040-
}
2041-
}
2042-
20432035
public static GitRefSpecHandle git_remote_get_refspec(RemoteSafeHandle remote, int n)
20442036
{
20452037
return NativeMethods.git_remote_get_refspec(remote, (UIntPtr)n);

LibGit2Sharp/Network.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,11 @@ public virtual void Push(
404404
GitRemoteCallbacks gitCallbacks = callbacks.GenerateCallbacks();
405405
Proxy.git_remote_set_callbacks(remoteHandle, ref gitCallbacks);
406406

407-
try
408-
{
409-
Proxy.git_remote_connect(remoteHandle, GitDirection.Push);
410-
Proxy.git_remote_push(remoteHandle, pushRefSpecs,
411-
new GitPushOptions()
412-
{
413-
PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism
414-
});
415-
}
416-
finally
417-
{
418-
Proxy.git_remote_disconnect(remoteHandle);
419-
}
407+
Proxy.git_remote_push(remoteHandle, pushRefSpecs,
408+
new GitPushOptions()
409+
{
410+
PackbuilderDegreeOfParallelism = pushOptions.PackbuilderDegreeOfParallelism
411+
});
420412
}
421413
}
422414

0 commit comments

Comments
 (0)