Package org.eclipse.jgit.storage.file

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


        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setGitDir(theDir).build();
    assertEqualsPath(theDir, r.getDirectory());
    assertEqualsPath(repo1Parent, r.getWorkTree());
    assertEqualsPath(new File(theDir, "index"), r.getIndexFile());
    assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase()
View Full Code Here


        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())
        .build();
    assertEqualsPath(theDir, r.getDirectory());
    assertEqualsPath(repo1Parent.getParentFile(), r.getWorkTree());
    assertEqualsPath(new File(theDir, "index"), r.getIndexFile());
View Full Code Here

        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setWorkTree(repo1Parent).build();
    assertEqualsPath(theDir, r.getDirectory());
    assertEqualsPath(repo1Parent, r.getWorkTree());
    assertEqualsPath(new File(theDir, "index"), r.getIndexFile());
    assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase()
View Full Code Here

    cfg.setString("core", null, "worktree", workdir.getAbsolutePath());
    cfg.save();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setGitDir(theDir).build();
    assertEqualsPath(theDir, r.getDirectory());
    assertEqualsPath(workdir, r.getWorkTree());
    assertEqualsPath(new File(theDir, "index"), r.getIndexFile());
    assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase()
View Full Code Here

    cfg.setString("core", null, "worktree", "../../rw");
    cfg.save();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder()
        .setGitDir(theDir).build();
    assertEqualsPath(theDir, r.getDirectory());
    assertEqualsPath(workdir, r.getWorkTree());
    assertEqualsPath(new File(theDir, "index"), r.getIndexFile());
    assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase()
View Full Code Here

        Constants.DOT_GIT));
    repo1initial.create();
    repo1initial.close();

    File theDir = new File(repo1Parent, Constants.DOT_GIT);
    FileRepository r = (FileRepository) new FileRepositoryBuilder() //
        .setGitDir(theDir).setObjectDirectory(objDir) //
        .addAlternateObjectDirectory(altObjDir) //
        .setIndexFile(indexFile) //
        .build();
    assertEqualsPath(theDir, r.getDirectory());
View Full Code Here

    File modulesGitDir = new File(db.getDirectory(), "modules"
        + 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

    File modulesGitDir = new File(db.getDirectory(), "modules"
        + File.separatorChar + path);
    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

    private Repository getRepository() {
        if (hasDotGit()) {
            try {
                final String repositoryPath = pathResolver
                        .getFocusedIdentifier(Path.ROOT, Constants.DOT_GIT);
                return new FileRepositoryBuilder().readEnvironment()
                        .findGitDir(new File(repositoryPath)).build();
            }
            catch (final IOException e) {
                throw new IllegalStateException(e);
            }
View Full Code Here

            person = new PersonIdent("Roo Git Add-On", "s2-roo@vmware.com");
        }
        try {
            final String repositoryPath = pathResolver.getFocusedIdentifier(
                    Path.ROOT, Constants.DOT_GIT);
            final Repository repository = new FileRepositoryBuilder()
                    .readEnvironment().setGitDir(new File(repositoryPath))
                    .build();
            repository.create();
        }
        catch (final Exception 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.