Skip to content

Remove manual connection to remote#1038

Merged
nulltoken merged 1 commit into
vNextfrom
Therzok-remove-forced-connection
May 24, 2015
Merged

Remove manual connection to remote#1038
nulltoken merged 1 commit into
vNextfrom
Therzok-remove-forced-connection

Conversation

@Therzok

@Therzok Therzok commented May 4, 2015

Copy link
Copy Markdown
Member

@Therzok

Therzok commented May 4, 2015

Copy link
Copy Markdown
Member Author

/cc @nulltoken

@Therzok

Therzok commented May 4, 2015

Copy link
Copy Markdown
Member Author

This resulted in double dialog asking for credentials on MonoDevelop, and I traced it back here.

@carlosmn

carlosmn commented May 4, 2015

Copy link
Copy Markdown
Member

The connect called from inside _push() should be a no-op. If it's connecting twice, that would mean it's a bug in libgit2.

@Therzok

Therzok commented May 4, 2015

Copy link
Copy Markdown
Member Author

Explanation:

Before, it was not attemping a remote connection if you were connected already to the remote. Now, it always attempts a connection.

@Therzok

Therzok commented May 4, 2015

Copy link
Copy Markdown
Member Author

This fixes the issue I was having though, so I'm pretty sure it's getting double connection in libgit2 land. I'm getting the credential callback twice, once from git_remote_connect, once from git_remote_push.

@carlosmn

carlosmn commented May 4, 2015

Copy link
Copy Markdown
Member

That would mean that _connect() tries to connect even though it's already connected, which is a bug, which you're hiding here, rather than fixing.

@Therzok

Therzok commented May 4, 2015

Copy link
Copy Markdown
Member Author

Opened an issue on libgit2 side. :P Until then, this works for me.

@nulltoken

Copy link
Copy Markdown
Member

@Therzok The amazing @carlosmn will work on the libgit2 side. Meanwhile, your proposal is sound. Could you please update your commit, and drop git_remote_connect() git_remote_disconnect() from the NativeMethods and Proxy types as well (as git_remote_free() takes care of calling it)?

@Therzok

Therzok commented May 23, 2015

Copy link
Copy Markdown
Member Author

@nulltoken it's not used only there.

git_remote_connect() is also used in Network.ListReferences(), which libgit2 doesn't seem to handle for connect/disconnect.

Also, libgit2/libgit2#3096 for reference.

@nulltoken

Copy link
Copy Markdown
Member

@Therzok Sorry. It was a typo. I meant _disconnect()

@Therzok
Therzok force-pushed the Therzok-remove-forced-connection branch from 4fa581f to 9ddca31 Compare May 24, 2015 14:01
@Therzok

Therzok commented May 24, 2015

Copy link
Copy Markdown
Member Author

Done.

@nulltoken nulltoken added this to the v0.22 milestone May 24, 2015
nulltoken added a commit that referenced this pull request May 24, 2015
@nulltoken
nulltoken merged commit 659be88 into vNext May 24, 2015
@nulltoken
nulltoken deleted the Therzok-remove-forced-connection branch May 24, 2015 16:41
@nulltoken

Copy link
Copy Markdown
Member

👍 🍌

@nulltoken

Copy link
Copy Markdown
Member

Published as NuGet pre-release package LibGit2Sharp.0.22.0-pre20150527180327

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants