Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.Repository.create()


          d = new File(d, Constants.DOT_GIT);
        builder.setGitDir(d);
      }
      Repository repository = builder.build();
      if (!repository.getObjectDatabase().exists())
        repository.create(bare);
      return new Git(repository);
    } catch (IOException e) {
      throw new JGitInternalException(e.getMessage(), e);
    }
  }
View Full Code Here


      if (!gitRepo.exists()) {
        gitRepo.getParentFile().mkdirs();
       
        r = b.build();
       
        r.create();
      } else {
        r = b.build();
      }
     
      git = Git.wrap(r);
View Full Code Here

        File gitDir = new File(repositoryToCreate.getText(),
            Constants.DOT_GIT);
        try {
          Repository repository = FileRepositoryBuilder
              .create(gitDir);
          repository.create();
          for (IProject project : getProjects(false).keySet()) {
            // If we don't refresh the project directories right
            // now we won't later know that a .git directory
            // exists within it and we won't mark the .git
            // directory as a team-private member. Failure
View Full Code Here

   * @param gitDir
   * @throws IOException
   */
  public TestRepository(File gitDir) throws IOException {
    Repository tmpRepository = FileRepositoryBuilder.create(gitDir);
    tmpRepository.create();
    tmpRepository.close();
    // use repository instance from RepositoryCache!
    repository = Activator.getDefault().getRepositoryCache().lookupRepository(gitDir);
    try {
      workdirPrefix = repository.getWorkTree().getCanonicalPath();
View Full Code Here

    File gitDir = new File(new File(testDirectory, repoName),
        Constants.DOT_GIT);
    Repository myRepository = new RepositoryBuilder().setGitDir(gitDir)
        .build();
    myRepository.create();

    // we need to commit into master first
    IProject firstProject = ResourcesPlugin.getWorkspace().getRoot()
        .getProject(PROJ1);
View Full Code Here

  protected File createRemoteRepository(File repositoryDir)
      throws Exception {
    Repository myRepository = lookupRepository(repositoryDir);
    File gitDir = new File(testDirectory, REPO2);
    Repository myRemoteRepository = FileRepositoryBuilder.create(gitDir);
    myRemoteRepository.create();
    // double-check that this is bare
    assertTrue(myRemoteRepository.isBare());

    createStableBranch(myRepository);
View Full Code Here

  // based on LocalRepositoryTestCase#createProjectAndCommitToRepository(String)
  protected void createEmptyRepository() throws Exception {
    File gitDir = new File(new File(getTestDirectory(), EMPTY_REPOSITORY),
        Constants.DOT_GIT);
    Repository myRepository = FileRepositoryBuilder.create(gitDir);
    myRepository.create();

    // we need to commit into master first
    IProject firstProject = ResourcesPlugin.getWorkspace().getRoot()
        .getProject(EMPTY_PROJECT);
View Full Code Here

    String gitdirName = "test" + System.currentTimeMillis()
        + Constants.DOT_GIT;
    File gitdir = new File(trash, gitdirName).getCanonicalFile();
    Repository db = new RepositoryBuilder().setGitDir(gitdir).build();
    assertFalse(gitdir.exists());
    db.create();
    return new TestRepository<Repository>(db);
  }

  private void generateSampleData(int n) throws Exception {
    A_txt = src.blob("A");
View Full Code Here

  @Test
  public void shareProjectWithAlreadyCreatedRepos() throws IOException,
      InterruptedException, JGitInternalException, GitAPIException {
    Repository repo1 = FileRepositoryBuilder.create(new File(
        createProject(projectName1), "../.git"));
    repo1.create();
    repo1.close();
    Repository repo2 = FileRepositoryBuilder.create(new File(
        createProject(projectName2), ".git"));
    repo2.create();
    repo2.close();
View Full Code Here

        createProject(projectName1), "../.git"));
    repo1.create();
    repo1.close();
    Repository repo2 = FileRepositoryBuilder.create(new File(
        createProject(projectName2), ".git"));
    repo2.create();
    repo2.close();
    Repository repo3 = FileRepositoryBuilder.create(new File(
        createProject(projectName3), ".git"));
    repo3.create();
    Git git = new Git(repo3);
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.