We have a helper for this.

https://github.com/libgit2/git2go/blob/master/git.go#L112