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


            Bundle bundle = findBundleForPlugin(bundleContext, id);
            if (bundle != null)
            {
                if (!repo.getObjectDatabase().exists())
                {
                    repo.create();
                    updateRepositoryIfDirty(repo, event, bundle);
                }
                else
                {
                    long modified = repo.getConfig().getLong("speakeasy", null, BUNDLELASTMODIFIED, 0);
View Full Code Here

            }
            else if (ExtensionValidate.isValidExtensionKey(id) &&
                    !repo.getDirectory().exists())
            {
                repo.create();
            }
            repositories.put(id, repo);
        }
        return repo;
    }
View Full Code Here

      loc = FileKey.exact(new File(basePath, n), FS.DETECTED);
    }

    try {
      Repository db = RepositoryCache.open(loc, false);
      db.create(true /* bare */);

      StoredConfig config = db.getConfig();
      config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION,
        null, ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, true);
      config.save();
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

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

          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

  @Test
  public void test000_openrepo_default_gitDirSet() throws IOException {
    File repo1Parent = new File(trash.getParentFile(), "r1");
    Repository repo1initial = new FileRepository(new File(repo1Parent,
        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setGitDir(theDir).build();
View Full Code Here

  public void test000_openrepo_default_gitDirAndWorkTreeSet()
      throws IOException {
    File repo1Parent = new File(trash.getParentFile(), "r1");
    Repository repo1initial = new FileRepository(new File(repo1Parent,
        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setGitDir(theDir).setWorkTree(repo1Parent.getParentFile())
View Full Code Here

  @Test
  public void test000_openrepo_default_workDirSet() throws IOException {
    File repo1Parent = new File(trash.getParentFile(), "r1");
    Repository repo1initial = new FileRepository(new File(repo1Parent,
        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setWorkTree(repo1Parent).build();
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.