Package org.eclipse.jgit.dircache

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


            ent.setFileMode(FileMode.GITLINK);
            ent.setObjectId(me.getValue().copy());
          }
        });
      }
      ed.finish();

      ObjectInserter oi = pdb.newObjectInserter();
      ObjectId tree = dc.writeTree(oi);

      final CommitBuilder commit = new CommitBuilder();
View Full Code Here


        }
      });
    } else {
      editor.add(new DeletePath(fileName));
    }
    editor.finish();
  }
}
View Full Code Here

  public void testOneOnly() throws IOException {
    DirCache dc1 = DirCache.newInCore();
    DirCache dc2 = DirCache.newInCore();
    DirCacheEditor editor = dc1.editor();
    editor.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    editor.finish();

    TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.addTree(new DirCacheIterator(dc1));
    tw.addTree(new DirCacheIterator(dc2));
View Full Code Here

  public void testTwoSame() throws IOException {
    DirCache dc1 = DirCache.newInCore();
    DirCache dc2 = DirCache.newInCore();
    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
View Full Code Here

    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.addTree(new DirCacheIterator(dc1));
    tw.addTree(new DirCacheIterator(dc2));
View Full Code Here

  public void testTwoSameDifferByAssumeValid() throws IOException {
    DirCache dc1 = DirCache.newInCore();
    DirCache dc2 = DirCache.newInCore();
    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, true));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
View Full Code Here

    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, false));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, true));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.addTree(new DirCacheIterator(dc1));
    tw.addTree(new DirCacheIterator(dc2));
View Full Code Here

      throws IOException {
    DirCache dc1 = DirCache.newInCore();
    DirCache dc2 = DirCache.newInCore();
    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, true));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("b"), 1, true));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
View Full Code Here

    DirCacheEditor ed1 = dc1.editor();
    ed1.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("a"), 1, true));
    ed1.finish();
    DirCacheEditor ed2 = dc2.editor();
    ed2.add(new AddEdit("a/a", FileMode.REGULAR_FILE, id("b"), 1, true));
    ed2.finish();

    TreeWalk tw = new TreeWalk(db);
    tw.setRecursive(true);
    tw.addTree(new DirCacheIterator(dc1));
    tw.addTree(new DirCacheIterator(dc2));
View Full Code Here

      public void apply(DirCacheEntry ent) {
        ent.setFileMode(FileMode.REGULAR_FILE);
      }
    });
    dce.finish();

    TreeWalk ret = new TreeWalk((ObjectReader) null);
    ret.reset();
    ret.setRecursive(true);
    ret.addTree(new DirCacheIterator(dc));
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.