Search in sources :

Example 16 with RepositoryUtil

use of org.eclipse.egit.core.RepositoryUtil in project egit by eclipse.

the class AbstractGitCloneWizard method executeCloneOperation.

private IStatus executeCloneOperation(final CloneOperation op, final GitRepositoryInfo repositoryInfo, final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
    final RepositoryUtil util = Activator.getDefault().getRepositoryUtil();
    op.run(monitor);
    util.addConfiguredRepository(op.getGitDir());
    try {
        if (repositoryInfo.shouldSaveCredentialsInSecureStore())
            SecureStoreUtils.storeCredentials(repositoryInfo.getCredentials(), new URIish(repositoryInfo.getCloneUri()));
    } catch (Exception e) {
        Activator.error(e.getMessage(), e);
    }
    return Status.OK_STATUS;
}
Also used : URIish(org.eclipse.jgit.transport.URIish) URISyntaxException(java.net.URISyntaxException) CoreException(org.eclipse.core.runtime.CoreException) NoRepositoryInfoException(org.eclipse.egit.ui.internal.provisional.wizards.NoRepositoryInfoException) InvocationTargetException(java.lang.reflect.InvocationTargetException) RepositoryUtil(org.eclipse.egit.core.RepositoryUtil)

Aggregations

RepositoryUtil (org.eclipse.egit.core.RepositoryUtil)16 File (java.io.File)8 IOException (java.io.IOException)6 IPath (org.eclipse.core.runtime.IPath)6 Path (org.eclipse.core.runtime.Path)5 Repository (org.eclipse.jgit.lib.Repository)4 IProject (org.eclipse.core.resources.IProject)3 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)3 URIish (org.eclipse.jgit.transport.URIish)3 Before (org.junit.Before)3 ArrayList (java.util.ArrayList)2 CoreException (org.eclipse.core.runtime.CoreException)2 CloneOperation (org.eclipse.egit.core.op.CloneOperation)2 RepositoryNode (org.eclipse.egit.ui.internal.repository.tree.RepositoryNode)2 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)2 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 Test (org.junit.Test)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1