Examples of RevBlob


Examples of org.eclipse.jgit.revwalk.RevBlob

  }

  @Test
  public void testGetCachedBytes() throws Exception {
    final String exp = "this is test data";
    RevBlob a = tr.blob("a");
    RevBlob data = tr.blob(exp);

    RevCommit r = tr.commit() //
        .add(a.name(), data) //
        .create();
    tr.parseBody(r);
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    assertEquals(exp, RawParseUtils.decode(act));
  }

  @Test
  public void testWriteUnchangedFlat() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");

    RevCommit r = tr.commit() //
        .add(a.name(), data1) //
        .add(b.name(), data2) //
        .add(".gitignore", "") //
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    assertSame("same tree", r.getTree(), n.getTree());
  }

  @Test
  public void testWriteUnchangedFanout2_38() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");

    RevCommit r = tr.commit() //
        .add(fanout(2, a.name()), data1) //
        .add(fanout(2, b.name()), data2) //
        .add(".gitignore", "") //
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    assertSame("same tree", r.getTree(), n.getTree());
  }

  @Test
  public void testCreateFromEmpty() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");

    NoteMap map = NoteMap.newEmptyMap();
    assertFalse("no a", map.contains(a));
    assertFalse("no b", map.contains(b));
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    assertFalse("no a", map.contains(a));
  }

  @Test
  public void testEditFlat() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");

    RevCommit r = tr.commit() //
        .add(a.name(), data1) //
        .add(b.name(), data2) //
        .add(".gitignore", "") //
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

        .forPath(reader, "zoo-animals.txt", n.getTree()).getObjectId(0));
  }

  @Test
  public void testEditFanout2_38() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");

    RevCommit r = tr.commit() //
        .add(fanout(2, a.name()), data1) //
        .add(fanout(2, b.name()), data2) //
        .add(".gitignore", "") //
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

        .forPath(reader, "zoo-animals.txt", n.getTree()).getObjectId(0));
  }

  @Test
  public void testLeafSplitsWhenFull() throws Exception {
    RevBlob data1 = tr.blob("data1");
    MutableObjectId idBuf = new MutableObjectId();

    RevCommit r = tr.commit() //
        .add(data1.name(), data1) //
        .create();
    tr.parseBody(r);

    NoteMap map = NoteMap.read(reader, r);
    for (int i = 0; i < 254; i++) {
      idBuf.setByte(Constants.OBJECT_ID_LENGTH - 1, i);
      map.set(idBuf, data1);
    }

    RevCommit n = commitNoteMap(map);
    TreeWalk tw = new TreeWalk(reader);
    tw.reset(n.getTree());
    while (tw.next())
      assertFalse("no fan-out subtree", tw.isSubtree());

    for (int i = 254; i < 256; i++) {
      idBuf.setByte(Constants.OBJECT_ID_LENGTH - 1, i);
      map.set(idBuf, data1);
    }
    idBuf.setByte(Constants.OBJECT_ID_LENGTH - 2, 1);
    map.set(idBuf, data1);
    n = commitNoteMap(map);

    // The 00 bucket is fully split.
    String path = fanout(38, idBuf.name());
    tw = TreeWalk.forPath(reader, path, n.getTree());
    assertNotNull("has " + path, tw);

    // The other bucket is not.
    path = fanout(2, data1.name());
    tw = TreeWalk.forPath(reader, path, n.getTree());
    assertNotNull("has " + path, tw);
  }
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    assertNotNull("has " + path, tw);
  }

  @Test
  public void testRemoveDeletesTreeFanout2_38() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob data1 = tr.blob("data1");
    RevTree empty = tr.tree();

    RevCommit r = tr.commit() //
        .add(fanout(2, a.name()), data1) //
        .create();
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    Iterator<Note> it = NoteMap.newEmptyMap().iterator();
    assertFalse(it.hasNext());
  }

  public void testIteratorFlatTree() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");
    RevBlob nonNote = tr.blob("non note");

    RevCommit r = tr.commit() //
        .add(a.name(), data1) //
        .add(b.name(), data2) //
        .add("nonNote", nonNote) //
View Full Code Here

Examples of org.eclipse.jgit.revwalk.RevBlob

    Iterator it = NoteMap.read(reader, r).iterator();
    assertEquals(2, count(it));
  }

  public void testIteratorFanoutTree2_38() throws Exception {
    RevBlob a = tr.blob("a");
    RevBlob b = tr.blob("b");
    RevBlob data1 = tr.blob("data1");
    RevBlob data2 = tr.blob("data2");
    RevBlob nonNote = tr.blob("non note");

    RevCommit r = tr.commit() //
        .add(fanout(2, a.name()), data1) //
        .add(fanout(2, b.name()), data2) //
        .add("nonNote", nonNote) //
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.