Package org.eclipse.egit.core.op

Examples of org.eclipse.egit.core.op.CloneOperation.run()


    // TODO only clone if not exists
    if (!exists) {
      final CloneOperation cloneOperation = new CloneOperation(gitUrl,
          true, null, workDir.toFile(), refName,
          Constants.DEFAULT_REMOTE_NAME, timeout);
      cloneOperation.run(monitor);
    }
  }

  private void getRepositories(final String[] referenceStrings,
      final Map<URIish, Map<String, Set<ProjectReference>>> repositories)
View Full Code Here


    URIish uri = new URIish("file:///" + remoteRepositoryFile.getPath());
    File workdir = new File(getTestDirectory(), "ClonedRepo");

    CloneOperation op = new CloneOperation(uri, true, null, workdir,
        "refs/heads/master", "origin", 0);
    op.run(null);

    clonedRepositoryFile = new File(workdir, Constants.DOT_GIT);

    // now let's clone the remote repository
    uri = new URIish(remoteRepositoryFile.getPath());
View Full Code Here

    uri = new URIish(remoteRepositoryFile.getPath());
    workdir = new File(getTestDirectory(), "ClonedRepo2");

    op = new CloneOperation(uri, true, null, workdir, "refs/heads/master",
        "origin", 0);
    op.run(null);

    clonedRepositoryFile2 = new File(workdir, Constants.DOT_GIT);

    clearView();
    deleteAllProjects();
View Full Code Here

    final URIish uri = new URIish(remoteRepositoryFile.getPath());
    final File workdir = new File(getTestDirectory(), "Cloned");

    CloneOperation op = new CloneOperation(uri, true, null, workdir,
        "refs/heads/master", "origin", 0);
    op.run(null);

    clonedRepositoryFile = new File(workdir, Constants.DOT_GIT);

    RepositoryUtil repositoryUtil = Activator.getDefault()
        .getRepositoryUtil();
View Full Code Here

    Repository myRepository = lookupRepository(repositoryDir);
    URIish uri = new URIish("file:///" + myRepository.getDirectory());
    File workdir = new File(testDirectory, CHILDREPO);
    CloneOperation clop = new CloneOperation(uri, true, null, workdir,
        "refs/heads/master", "origin", 0);
    clop.run(null);
    return new File(workdir, Constants.DOT_GIT);
  }

  protected static void createStableBranch(Repository myRepository)
      throws IOException {
View Full Code Here

      try {
        int timeout = 60;
        final CloneOperation cloneOperation = new CloneOperation(
            gitUrl, true, null, workDir.toFile(), refToCheckout,
            Constants.DEFAULT_REMOTE_NAME, timeout);
        cloneOperation.run(monitor);

        return repositoryPath;
      } catch (final InvocationTargetException e) {
        throw getTeamException(e);
      }
View Full Code Here

  private void cloneAndAssert(String refName) throws Exception {
    URIish uri = new URIish("file:///"
        + repository1.getRepository().getDirectory().toString());
    CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
        refName, "origin", 0);
    clop.run(null);

    Repository clonedRepo = FileRepositoryBuilder.create(new File(workdir2,
        Constants.DOT_GIT));
    assertEquals(
        "",
View Full Code Here

          throws CoreException {
        repoDir[0] = repository.getDirectory();

      }
    });
    clop.run(null);
    File newRepoDir = new File(workdir2, Constants.DOT_GIT);
    assertEquals(newRepoDir, repoDir[0]);
  }

  @Test
View Full Code Here

    CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
        "refs/heads/master", "origin", 0);

    clop.addPostCloneTask(new ConfigurePushAfterCloneTask("origin",
        "HEAD:refs/for/master", new URIish("file:///pushtarget")));
    clop.run(null);
    Repository clonedRepo = FileRepositoryBuilder.create(new File(workdir2,
        Constants.DOT_GIT));
    assertEquals(
        "",
        "HEAD:refs/for/master",
View Full Code Here

    CloneOperation clop = new CloneOperation(uri, true, null, workdir2,
        "refs/heads/master", "origin", 0);

    clop.addPostCloneTask(new ConfigureFetchAfterCloneTask("origin",
        "refs/notes/review:refs/notes/review"));
    clop.run(null);
    Repository clonedRepo = FileRepositoryBuilder.create(new File(workdir2,
        Constants.DOT_GIT));
    assertTrue(
        clonedRepo.getConfig()
        .getStringList(ConfigConstants.CONFIG_REMOTE_SECTION,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.