Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCacheEditor.commit()


      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    SubmoduleWalk gen = SubmoduleWalk.forIndex(db);
    assertTrue(gen.next());
    assertEquals(path, gen.getPath());
    assertEquals(id, gen.getObjectId());
View Full Code Here


      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    SubmoduleWalk gen = SubmoduleWalk.forIndex(db);
    assertTrue(gen.next());
    assertEquals(path, gen.getPath());
    assertEquals(id, gen.getObjectId());
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id2);
      }
    });
    editor.commit();

    SubmoduleWalk gen = SubmoduleWalk.forIndex(db);
    gen.setFilter(PathFilter.create(path1));
    assertTrue(gen.next());
    assertEquals(path1, gen.getPath());
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.REGULAR_FILE);
        ent.setObjectId(gitmodulesBlob);
      }
    });
    editor.commit();

    SubmoduleWalk gen = SubmoduleWalk.forIndex(db);
    assertTrue(gen.next());
    assertEquals(path, gen.getPath());
    assertEquals(subId, gen.getObjectId());
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.EXECUTABLE_FILE);
        ent.setObjectId(walk.getObjectId(0));
      }
    });
    assertTrue(editor.commit());
    RevCommit c2 = git.commit().setMessage("second commit").call();
    walk.reset();
    walk.addTree(c1.getTree());
    walk.addTree(c2.getTree());
    List<DiffEntry> diffs = DiffEntry.scan(walk, false);
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();
    return path;
  }
}
View Full Code Here

        ent.setFileMode(FileMode.SYMLINK);
        ent.setObjectId(linkid);
        ent.setLength(NORMALIZED_BYTES.length);
      }
    });
    assertTrue(dce.commit());
    new Git(db).commit().setMessage("Adding link").call();
    new Git(db).reset().setMode(ResetType.HARD).call();

    FileUtils.delete(new File(trash, "link"), FileUtils.NONE);
    FS.DETECTED.createSymLink(new File(trash, "link"), "newtarget");
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(commit);
      }
    });
    editor.commit();

    StoredConfig config = db.getConfig();
    config.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
        ConfigConstants.CONFIG_KEY_URL, db.getDirectory().toURI()
            .toString());
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    FileBasedConfig modulesConfig = new FileBasedConfig(new File(
        db.getWorkTree(), Constants.DOT_GIT_MODULES), db.getFS());
    modulesConfig.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
        ConfigConstants.CONFIG_KEY_PATH, path);
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.GITLINK);
        ent.setObjectId(id);
      }
    });
    editor.commit();

    Repository subRepo = Git.init().setBare(false)
        .setDirectory(new File(db.getWorkTree(), path)).call()
        .getRepository();
    assertNotNull(subRepo);
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.