Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.FileRepositoryBuilder.build()


        "gitdir: " + repo1.getDirectory().getAbsolutePath()).close();
    FileRepositoryBuilder builder = new FileRepositoryBuilder();

    builder.setWorkTree(dir);
    builder.setMustExist(true);
    Repository repo2 = builder.build();

    assertEquals(repo1.getDirectory().getAbsolutePath(), repo2
        .getDirectory().getAbsolutePath());
    assertEquals(dir, repo2.getWorkTree());
  }
View Full Code Here


        .close();

    FileRepositoryBuilder builder = new FileRepositoryBuilder();
    builder.setWorkTree(dir);
    builder.setMustExist(true);
    Repository repo2 = builder.build();

    // The tmp directory may be a symlink so the actual path
    // may not
    assertEquals(repo1.getDirectory().getCanonicalPath(), repo2
        .getDirectory().getCanonicalPath());
View Full Code Here

    builder.setWorkTree(dir);
    builder.findGitDir(dir);
    assertEquals(repo1.getDirectory().getAbsolutePath(), builder
        .getGitDir().getAbsolutePath());
    builder.setMustExist(true);
    Repository repo2 = builder.build();

    // The tmp directory may be a symlink
    assertEquals(repo1.getDirectory().getCanonicalPath(), repo2
        .getDirectory().getCanonicalPath());
    assertEquals(dir, repo2.getWorkTree());
View Full Code Here

        + File.separatorChar + path);
    new FileWriter(dotGit).append(
        "gitdir: " + modulesGitDir.getAbsolutePath()).close();
    FileRepositoryBuilder builder = new FileRepositoryBuilder();
    builder.setWorkTree(new File(db.getWorkTree(), path));
    builder.build().create();

    DirCache cache = db.lockDirCache();
    DirCacheEditor editor = cache.editor();
    editor.add(new PathEdit(path) {
View Full Code Here

    new FileWriter(dotGit).append(
        "gitdir: " + "../" + Constants.DOT_GIT + "/modules/" + path)
        .close();
    FileRepositoryBuilder builder = new FileRepositoryBuilder();
    builder.setWorkTree(new File(db.getWorkTree(), path));
    builder.build().create();

    DirCache cache = db.lockDirCache();
    DirCacheEditor editor = cache.editor();
    editor.add(new PathEdit(path) {
View Full Code Here

            final File projectDir = project.getProjectDir();
            final FileRepositoryBuilder repoBuilder = new FileRepositoryBuilder().readEnvironment().findGitDir(projectDir);
            if (repoBuilder.getGitDir() == null) {
                throw new ReleaseException("No git directory found!");
            }
            return repoBuilder.build();
        }
        catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }
View Full Code Here

    public void setup() throws Exception {
        this.repo = mock(Repository.class, RETURNS_DEEP_STUBS);

        FileRepositoryBuilder repoBuilder = mock(FileRepositoryBuilder.class);
        whenNew(FileRepositoryBuilder.class).withNoArguments().thenReturn(repoBuilder);
        when(repoBuilder.build()).thenReturn(this.repo);

        File someDir = mock(File.class);
        when(someDir.exists()).thenReturn(true);

        this.repository = new JGitRepository(someDir, someDir);
View Full Code Here

                throw new GitRepositoryException(workTree + " is not inside a Git repository. Please specify the GIT_DIR separately.");
            }
        }

        try {
            this.repository = repositoryBuilder.build();
        } catch (IOException e) {
            throw new GitRepositoryException("Could not initialize repository", e);
        }

        this.commitCache = new HashMap<ObjectId, RevCommit>();
View Full Code Here

            final File projectDir = project.getProjectDir();
            final FileRepositoryBuilder repoBuilder = new FileRepositoryBuilder().readEnvironment().findGitDir(projectDir);
            if (repoBuilder.getGitDir() == null) {
                throw new ReleaseException("No git directory found!");
            }
            return repoBuilder.build();
        }
        catch (IOException e) {
            throw new IllegalStateException(e);
        }
    }
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.