libgit2/libgit2sharp — pull request #213 by jamill (2012-09-12 15:29:27+00:00)
Title: Win http fetch

An updated Fetch implementation based off of @Ben's repository, from suggestions in Pull Request #206. This includes a basic test for fetching from a remote into an empty repository. I made some choices on how / where to expose this functionality, so please let me know if you have thoughts / comments / questions.

#### Missing functionality:
* It does not appear that libgit2 fetches tags
* Tests do no cover fetching tags
* Completion callback in git_remote_callbacks does not appear to be called by libgit2
* Completion callback not plumbed through LibGit2Sharp

#### Implementation:
* I have exposed the git_remote_callbacks as a property on the FetchProgress object that is passed into Fetch(). This is slightly different than how it is organized in libgit2 (where the callbacks are added to the remote itself). I went this way because the lifetime of these callbacks seems tied to the actual fetch operation itself, at least in how I see callers of the LibGit2Sharp API. If I am missing something and this is not the appropriate place, please let me know.
* I slighty changed the signature on the clone interface to so that callers of the LibGit2Sharp do not have to include the LibGitSharp.Core namespace. Instead, I added a wrapper around GitIndexerStats for LibGit2Sharp callers, and exposed the uint fields as long properties.
* I expose the libgit2 C callbacks as Events on the LibGit2Sharp interface.

#### Issues:
I have seen intermittent failures from libgit2 during both the clone and fetch tests that I have not tracked down at this point (as part of call to git_remote_update_tips in fetch, and git_clone in Clone).

LibGit2Sharp.LibGit2SharpException : An error was raised by libgit2. Category = Reference (Error).
Target OID for the reference doesn't exist on the repository