Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.FileTreeEntry


  @Test
  public void test012_SubtreeExternalSorting() throws IOException {
    final ObjectId emptyBlob = insertEmptyBlob();
    final Tree t = new Tree(db);
    final FileTreeEntry e0 = t.addFile("a-");
    final FileTreeEntry e1 = t.addFile("a-b");
    final FileTreeEntry e2 = t.addFile("a/b");
    final FileTreeEntry e3 = t.addFile("a=");
    final FileTreeEntry e4 = t.addFile("a=b");

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

    final Tree a = (Tree) t.findTreeMember("a");
    a.setId(insertTree(a));
    assertEquals(ObjectId
        .fromString("b47a8f0a4190f7572e11212769090523e23eb1ea"),
View Full Code Here


  @Test
  public void test021_createTreeTag() throws IOException {
    final ObjectId emptyId = insertEmptyBlob();
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId,
        "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = insertTree(almostEmptyTree);
    final TagBuilder t = new TagBuilder();
    t.setObjectId(almostEmptyTreeId, Constants.OBJ_TREE);
    t.setTag("test021");
View Full Code Here

  @Test
  public void test022_createCommitTag() throws IOException {
    final ObjectId emptyId = insertEmptyBlob();
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId,
        "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = insertTree(almostEmptyTree);
    final CommitBuilder almostEmptyCommit = new CommitBuilder();
    almostEmptyCommit.setAuthor(new PersonIdent(author, 1154236443000L,
        -2 * 60)); // not exactly the same
View Full Code Here

  @Test
  public void test023_createCommitNonAnullii() throws IOException {
    final ObjectId emptyId = insertEmptyBlob();
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId,
        "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = insertTree(almostEmptyTree);
    CommitBuilder commit = new CommitBuilder();
    commit.setTreeId(almostEmptyTreeId);
    commit.setAuthor(new PersonIdent("Joe H\u00e4cker", "joe@example.com",
View Full Code Here

  @Test
  public void test024_createCommitNonAscii() throws IOException {
    final ObjectId emptyId = insertEmptyBlob();
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId,
        "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = insertTree(almostEmptyTree);
    CommitBuilder commit = new CommitBuilder();
    commit.setTreeId(almostEmptyTreeId);
    commit.setAuthor(new PersonIdent("Joe H\u00e4cker", "joe@example.com",
View Full Code Here

    final RevTree tree_root, tree_A, tree_AB;
    final RevCommit b;
    {
      Tree root = new Tree(db);
      Tree A = root.addTree("A");
      FileTreeEntry B = root.addFile("B");
      B.setId(bId);

      Tree A_A = A.addTree("A");
      Tree A_B = A.addTree("B");

      final ObjectInserter inserter = db.newObjectInserter();
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);
View Full Code Here

  }

  public void test012_SubtreeExternalSorting() throws IOException {
    final ObjectId emptyBlob = new ObjectWriter(db).writeBlob(new byte[0]);
    final Tree t = new Tree(db);
    final FileTreeEntry e0 = t.addFile("a-");
    final FileTreeEntry e1 = t.addFile("a-b");
    final FileTreeEntry e2 = t.addFile("a/b");
    final FileTreeEntry e3 = t.addFile("a=");
    final FileTreeEntry e4 = t.addFile("a=b");

    e0.setId(emptyBlob);
    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());
  }
View Full Code Here

  }

  public void test021_createTreeTag() throws IOException {
    final ObjectId emptyId = new ObjectWriter(db).writeBlob(new byte[0]);
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId, "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = new ObjectWriter(db).writeTree(almostEmptyTree);
    final Tag t = new Tag(db);
    t.setObjId(almostEmptyTreeId);
    t.setType("tree");
    t.setTag("test021");
View Full Code Here

  }

  public void test022_createCommitTag() throws IOException {
    final ObjectId emptyId = new ObjectWriter(db).writeBlob(new byte[0]);
    final Tree almostEmptyTree = new Tree(db);
    almostEmptyTree.addEntry(new FileTreeEntry(almostEmptyTree, emptyId, "empty".getBytes(), false));
    final ObjectId almostEmptyTreeId = new ObjectWriter(db).writeTree(almostEmptyTree);
    final Commit almostEmptyCommit = new Commit(db);
    almostEmptyCommit.setAuthor(new PersonIdent(author, 1154236443000L, -2 * 60)); // not exactly the same
    almostEmptyCommit.setCommitter(new PersonIdent(author, 1154236443000L, -2 * 60));
    almostEmptyCommit.setMessage("test022\n");
 
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.FileTreeEntry

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.