The Branch struct seems like it's not a good thing. Libgit2 branch functions all operate on git_reference, not a git_branch struct. Using different struct here for branch makes it impossible to call branch functions on references which may be branches.