Package org.eclipse.jgit.dircache

Examples of org.eclipse.jgit.dircache.DirCache.builder()


    final DirCache treeO = db.readDirCache();
    final DirCache treeT = db.readDirCache();
    {
      final DirCacheBuilder b = treeB.builder();
      final DirCacheBuilder o = treeO.builder();
      final DirCacheBuilder t = treeT.builder();

      b.add(createEntry("d", FileMode.REGULAR_FILE));

      o.add(createEntry("d", FileMode.REGULAR_FILE, "o !"));
View Full Code Here


    final DirCache treeO = db.readDirCache();
    final DirCache treeT = db.readDirCache();
    {
      final DirCacheBuilder b = treeB.builder();
      final DirCacheBuilder o = treeO.builder();
      final DirCacheBuilder t = treeT.builder();

      b.add(createEntry("d", FileMode.REGULAR_FILE));

      o.add(createEntry("d/o", FileMode.REGULAR_FILE));
View Full Code Here

  @Test
  public void commitOnlyShouldCommitUnmergedPathAndNotAffectOthers()
      throws Exception {
    DirCache index = db.lockDirCache();
    DirCacheBuilder builder = index.builder();
    addUnmergedEntry("unmerged1", builder);
    addUnmergedEntry("unmerged2", builder);
    DirCacheEntry other = new DirCacheEntry("other");
    other.setFileMode(FileMode.REGULAR_FILE);
    builder.add(other);
View Full Code Here

    final DirCache treeT = db.readDirCache();
    {
      final DirCacheBuilder b = treeB.builder();
      final DirCacheBuilder o = treeO.builder();
      final DirCacheBuilder p = treeP.builder();
      final DirCacheBuilder t = treeT.builder();

      b.add(createEntry("a", FileMode.REGULAR_FILE));

      o.add(createEntry("a", FileMode.REGULAR_FILE));
      o.add(createEntry("o", FileMode.REGULAR_FILE));
View Full Code Here

    final DirCache treeP = db.readDirCache();
    final DirCache treeT = db.readDirCache();
    {
      final DirCacheBuilder b = treeB.builder();
      final DirCacheBuilder p = treeP.builder();
      final DirCacheBuilder t = treeT.builder();

      b.add(createEntry("a", FileMode.REGULAR_FILE));

      p.add(createEntry("a", FileMode.REGULAR_FILE, "q"));
      p.add(createEntry("p-fail", FileMode.REGULAR_FILE));
View Full Code Here

  private void resetIndex(RevTree tree) throws IOException {
    DirCache dc = repo.lockDirCache();
    TreeWalk walk = null;
    try {
      DirCacheBuilder builder = dc.builder();

      walk = new TreeWalk(repo);
      walk.addTree(tree);
      walk.addTree(new DirCacheIterator(dc));
      walk.setRecursive(true);
View Full Code Here

   * @return reference to the tree specified by the entry list.
   * @throws Exception
   */
  public RevTree tree(final DirCacheEntry... entries) throws Exception {
    final DirCache dc = DirCache.newInCore();
    final DirCacheBuilder b = dc.builder();
    for (final DirCacheEntry e : entries)
      b.add(e);
    b.finish();
    ObjectId root;
    try {
View Full Code Here

  }

  public void testNoPostOrder() throws Exception {
    final DirCache tree = db.readDirCache();
    {
      final DirCacheBuilder b = tree.builder();

      b.add(makeFile("a"));
      b.add(makeFile("b/c"));
      b.add(makeFile("b/d"));
      b.add(makeFile("q"));
View Full Code Here

  }

  public void testWithPostOrder_EnterSubtree() throws Exception {
    final DirCache tree = db.readDirCache();
    {
      final DirCacheBuilder b = tree.builder();

      b.add(makeFile("a"));
      b.add(makeFile("b/c"));
      b.add(makeFile("b/d"));
      b.add(makeFile("q"));
View Full Code Here

  }

  public void testWithPostOrder_NoEnterSubtree() throws Exception {
    final DirCache tree = db.readDirCache();
    {
      final DirCacheBuilder b = tree.builder();

      b.add(makeFile("a"));
      b.add(makeFile("b/c"));
      b.add(makeFile("b/d"));
      b.add(makeFile("q"));
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.