Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.Tree.accept()


    // open when we create it we won't write the object file out as a loose
    // object (as it already exists in the pack).
    //
    final Repository newdb = createBareRepository();
    final Tree t = new Tree(newdb);
    t.accept(new WriteTree(trash, newdb), TreeEntry.MODIFIED_ONLY);
    assertEquals("4b825dc642cb6eb9a060e54bf8d69288fbee4904", t.getId()
        .name());
    final File o = new File(new File(new File(newdb.getDirectory(),
        "objects"), "4b"), "825dc642cb6eb9a060e54bf8d69288fbee4904");
    assertTrue("Exists " + o, o.isFile());
View Full Code Here


  public void test002_WriteEmptyTree2() throws IOException {
    // File shouldn't exist as it is in a test pack.
    //
    final Tree t = new Tree(db);
    t.accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);
    assertEquals("4b825dc642cb6eb9a060e54bf8d69288fbee4904", t.getId()
        .name());
    final File o = new File(new File(
        new File(db.getDirectory(), "objects"), "4b"),
        "825dc642cb6eb9a060e54bf8d69288fbee4904");
View Full Code Here

  public void test003_WriteShouldBeEmptyTree() throws IOException {
    final Tree t = new Tree(db);
    final ObjectId emptyId = new ObjectWriter(db).writeBlob(new byte[0]);
    t.addFile("should-be-empty").setId(emptyId);
    t.accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);
    assertEquals("7bb943559a305bdd6bdee2cef6e5df2413c3d30a", t.getId()
        .name());

    File o;
    o = new File(new File(new File(db.getDirectory(), "objects"), "7b"),
View Full Code Here

  public void test009_CreateCommitOldFormat() throws IOException {
    final Tree t = new Tree(db);
    final FileTreeEntry f = t.addFile("i-am-a-file");
    writeTrashFile(f.getName(), "and this is the data in me\n");
    t.accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);
    assertEquals(ObjectId.fromString("00b1f73724f493096d1ffa0b0f1f1482dbb8c936"),
        t.getTreeId());

    final Commit c = new Commit(db);
    c.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
 
View Full Code Here

    e1.setId(emptyBlob);
    e2.setId(emptyBlob);
    e3.setId(emptyBlob);
    e4.setId(emptyBlob);

    t.accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);
    assertEquals(ObjectId.fromString("b47a8f0a4190f7572e11212769090523e23eb1ea"),
        t.getId());
  }

  public void test020_createBlobTag() throws IOException {
View Full Code Here

  public void test026_CreateCommitMultipleparents() throws IOException {
    final Tree t = new Tree(db);
    final FileTreeEntry f = t.addFile("i-am-a-file");
    writeTrashFile(f.getName(), "and this is the data in me\n");
    t.accept(new WriteTree(trash, db), TreeEntry.MODIFIED_ONLY);
    assertEquals(ObjectId.fromString("00b1f73724f493096d1ffa0b0f1f1482dbb8c936"),
        t.getTreeId());

    final Commit c1 = new Commit(db);
    c1.setAuthor(new PersonIdent(author, 1154236443000L, -4 * 60));
 
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.