import org.apache.tools.ant.Task;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.InitCommand;
+import org.eclipse.jgit.api.errors.JGitInternalException;
/**
* Create an empty git repository.
} else {
log("Initializing repository at " + destination);
}
- InitCommand init = Git.init();
- init.setBare(bare).setDirectory(destination);
- init.call();
+ try {
+ InitCommand init = Git.init();
+ init.setBare(bare).setDirectory(destination);
+ init.call();
+ } catch (JGitInternalException e) {
+ throw new BuildException("Could not initialize repository", e);
+ }
}
}