Move some code to GitRepository and use libGit2Sharp api