public GitRepository(final File sourceDirectory) {
this.sourceDirectory = sourceDirectory;
}
public Git load() throws IOException {
Repository repository = new RepositoryBuilder().findGitDir(this.sourceDirectory).build();
try {
Git.Head head = getHead(repository);
String branch = getBranch(repository);
List<Git.Remote> remotes = getRemotes(repository);
return new Git(repository.getWorkTree(), head, branch, remotes);