libgit2/libgit2 — pull request #631 by schu (2012-04-17 12:46:18+00:00)
Title: RFC: fetch fixes

4deaa125 fixes a buggy git ```git_negotiate_fetch``` – @carlosmn, I've basically restored the old behaviour; mabye you had something else in mind when changing most of the function?

fcd5be85 isn't meant to be applied – since 1db9d2c3, ```git_commit_filebuf``` requires filebuf.path_lock and filebuf.path_original to be different paths. Usually they are (```foo/bar.txt``` and ```foo/bar.txt.lock``` for example), but not when creating a temporary filebuf GIT_FILEBUF_TEMPORARY in conjunction with ```git_filebuf_commit_at``` and ```path == filebuf.path_lock``` (like in ```git_fetch__download_pack```). In this case, ```git_commit_filebuf``` will fail since it's deleting the source file path_lock before trying to rename it to path_original. I would tend to change the filebuf code to be more predictable (*1*) before tackling the issue. Thoughts?

(*1* ) IMHO the GIT_FILEBUF_TEMPORARY code path in ```git_filebuf_open``` should create what we expect from a filebuf: we have path_original and path_lock, holding the corresponding lock for the temporary file.