https://github.com/libgit2/rugged/pull/355