libgit2/libgit2 — pull request #539 by nulltoken (2012-01-21 13:40:47+00:00)
Title: remote: Change signature of git_remote_download() to be more binding friendly

From a C#/.Net binding, it is very [tricky](http://stackoverflow.com/questions/7322503) to properly release the *filename* buffer that is being allocated by `git_remote_download()`.

This patch takes its inspiration from the `git_repository_discover()` signature which has already been successfully bound in LibGit2Sharp.

From now on, the consumer is required to provide a pre-allocated buffer. Of course, the consumer will still be responsible for freeing it.

`git_remote_download()` will no longer allocate the buffer. It will only fills the buffer with the temporary name. If the buffer is too small to hold the path to the packfile, `GIT_ESHORTBUFFER` will be returned.

If no packfile has been downloaded, the buffer will cleared/set to empty.