e.printStackTrace(listener.error(Messages.GitAPI_Workspace_FailedCleanupMsg()));
throw new GitException(Messages.GitAPI_Workspace_FailedDeleteMsg(), e);
}
// Assume only 1 URL for this repository
final URIish source = remoteConfig.getURIs().get(0);
try {
workspace.act(new FilePath.FileCallable<String>() {
private static final long serialVersionUID = 1L;
public String invoke(File workspace,
VirtualChannel channel) throws IOException {
jGitDelegate = Git.cloneRepository()
.setDirectory(workspace.getAbsoluteFile())
.setURI(source.toPrivateString())
.setRemote(remoteConfig.getName())
.call();
return Messages.GitAPI_Repository_CloneSuccessMsg(source.toPrivateString(),
workspace.getAbsolutePath());
}
});
} catch (Exception e) {
throw new GitException(Messages.GitAPI_Repository_FailedCloneMsg(source), e);