Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileRepositoryBuilder


        values = new Values(factories(), getContext().getBinaryStore());

        // Set up the repository instance. We expect it to exist, and will use it as a "bare" repository (meaning
        // that no working directory will be used nor needs to exist) ...
        repository = new FileRepositoryBuilder().setGitDir(gitDir).setMustExist(true).setBare().build();
        git = new Git(repository);

        // Make sure the remote exists ...
        Set<String> remoteNames = repository.getConfig().getSubsections("remote");
        parsedRemoteNames = new ArrayList<String>();
View Full Code Here


       
        Repository mainRepo = openMainRepo(mainRepoDir);
       
        addSubmodule(mainRepo);
       
        FileRepositoryBuilder builder = new FileRepositoryBuilder();

        Repository subRepo = builder.setGitDir(new File("testrepo/.git"))
          .readEnvironment() // scan environment GIT_* variables
          .findGitDir() // scan up the file system tree
          .build();

        if(subRepo.isBare()) {
View Full Code Here

            throw new IllegalStateException("Repository at " + subRepoInit.getDirectory() + " should not be bare");
        }
    }

    private static Repository openMainRepo(File mainRepoDir) throws IOException {
        FileRepositoryBuilder builder = new FileRepositoryBuilder();

        Repository mainRepo = builder.setGitDir(new File(mainRepoDir.getAbsolutePath(), ".git"))
          .readEnvironment() // scan environment GIT_* variables
          .findGitDir() // scan up the file system tree
          .build();

        if(mainRepo.isBare()) {
View Full Code Here

                .setURI("file://" + localPath)
                .setDirectory(localPath2)
                .call();

        // now open the created repository
        FileRepositoryBuilder builder = new FileRepositoryBuilder();
        Repository repository = builder.setGitDir(localPath2)
                .readEnvironment() // scan environment GIT_* variables
                .findGitDir() // scan up the file system tree
                .build();

        Git git = new Git(repository);
View Full Code Here

                .setURI(REMOTE_URL)
                .setDirectory(localPath)
                .call();

        // now open the created repository
        FileRepositoryBuilder builder = new FileRepositoryBuilder();
        Repository repository = builder.setGitDir(localPath)
                .readEnvironment() // scan environment GIT_* variables
                .findGitDir() // scan up the file system tree
                .build();

        Git git = new Git(repository);
View Full Code Here

    public static void main(String[] args) throws IOException, GitAPIException {
        // first create a test-repository, the return is including the .get directory here!
        File repoDir = createSampleGitRepo();
       
        // now open the resulting repository with a FileRepositoryBuilder
        FileRepositoryBuilder builder = new FileRepositoryBuilder();
        Repository repository = builder.setGitDir(repoDir)
                .readEnvironment() // scan environment GIT_* variables
                .findGitDir() // scan up the file system tree
                .build();

        System.out.println("Having repository: " + repository.getDirectory());
View Full Code Here


public class CookbookHelper {

    public static Repository openJGitCookbookRepository() throws IOException {
        FileRepositoryBuilder builder = new FileRepositoryBuilder();
        Repository repository = builder
                .readEnvironment() // scan environment GIT_* variables
                .findGitDir() // scan up the file system tree
                .build();
        return repository;
    }
View Full Code Here

    private void convertRepo(String path)
        throws IOException, AmbiguousObjectException,
        MissingObjectException, IncorrectObjectTypeException,
        CorruptObjectException, SolrServerException {
      FileRepositoryBuilder builder = new FileRepositoryBuilder();
      Repository repository = builder.setGitDir(new File(path)).build();
     
      RevWalk walk = new RevWalk(repository);

      Config storedConfig = repository.getConfig();
      Set<String> remotes = storedConfig.getSubsections("remote");
View Full Code Here

    return new GitVersionInfo(revCommit.name(), authorIdent.getName(), authorIdent.getWhen(), revCommit.getShortMessage());
  }

  public static Repository getRepository(File file) {
    try {
      return new FileRepositoryBuilder()
              .findGitDir(file)
              .readEnvironment()
              .setMustExist(true)
              .build();
    } catch (IOException e) {
View Full Code Here

  @NotNull
  private Repository getGitRepository() throws MojoExecutionException {
    Repository repository;

    FileRepositoryBuilder repositoryBuilder = new FileRepositoryBuilder();
    try {
      repository = repositoryBuilder
          .setGitDir(dotGitDirectory)
          .readEnvironment() // scan environment GIT_* variables
          .findGitDir() // scan up the file system tree
          .build();
    } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.FileRepositoryBuilder

Copyright © 2018 www.massapicom. 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.