Bring libgit2 up-to-date

As it says on the tin ;-). This has the new patch API in (a small part of it). I'm PRing it so you guys can grab it if you want, but I intend to continue polishing it — at least until tests are good (3 failures), and doc is written (I've glanced over the new GTPatch thing). I've left a few TODOs in there because I'm working quickly ;).