Skip to content

Remove manual connection to remote #1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions LibGit2Sharp/Core/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,6 @@ internal static extern int git_remote_delete(
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,
Expand Down
8 changes: 0 additions & 8 deletions LibGit2Sharp/Core/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2032,14 +2032,6 @@ public static void git_remote_delete(RepositorySafeHandle repo, string name)
}
}

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);
Expand Down
18 changes: 5 additions & 13 deletions LibGit2Sharp/Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,11 @@ public virtual void Push(
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
});
}
}

Expand Down