libgit2 / libgit2sharp

Git + .NET = ❤
http://libgit2.github.com
MIT License
3.15k stars 887 forks source link

Fix git_remote_connect not throwing on non-zero result #1913

Closed YuKitsune closed 2 years ago

YuKitsune commented 2 years ago

Fixes https://github.com/libgit2/libgit2sharp/issues/1912

Couldn't really find a good spot to add tests here, open to suggestions.

bording commented 2 years ago

Looking at this code, I'm now wondering why it only tries to dispose customHeaders when an exception has occurred. It seems to me that it either should always be disposing, or it never actually needs to dispose.

Regardless, this PR is an improvement, so thanks for the contribution!

bording commented 2 years ago

LibGit2Sharp 0.27.0-preview-0182 includes this change.