Stash support

_Depends on libgit2/libgit2#1881._

Bringing #198 up to date and fixing up review notes.