Package org.eclipse.jgit.junit.TestRepository

Examples of org.eclipse.jgit.junit.TestRepository.BranchBuilder.commit()


  @Test
  public void testRecursiveMergeWithConflict() throws Exception {
    TestRepository<Repository> db_t = new TestRepository<Repository>(db);
    BranchBuilder master = db_t.branch("master");
    RevCommit m0 = master.commit().add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9\n")
        .message("m0").create();
    RevCommit m1 = master.commit()
        .add("f", "1-master\n2\n3\n4\n5\n6\n7\n8\n9\n").message("m1")
        .create();
    db_t.getRevWalk().parseCommit(m1);
View Full Code Here


  public void testRecursiveMergeWithConflict() throws Exception {
    TestRepository<Repository> db_t = new TestRepository<Repository>(db);
    BranchBuilder master = db_t.branch("master");
    RevCommit m0 = master.commit().add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9\n")
        .message("m0").create();
    RevCommit m1 = master.commit()
        .add("f", "1-master\n2\n3\n4\n5\n6\n7\n8\n9\n").message("m1")
        .create();
    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
View Full Code Here

        .add("f", "1-master\n2\n3\n4\n5\n6\n7\n8\n9\n").message("m1")
        .create();
    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0)
        .add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9-side\n").message("s1")
        .create();
    RevCommit s2 = side.commit().parent(m1)
        .add("f", "1-master\n2\n3\n4\n5\n6\n7-res(side)\n8\n9-side\n")
        .message("s2(merge)").create();
View Full Code Here

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0)
        .add("f", "1\n2\n3\n4\n5\n6\n7\n8\n9-side\n").message("s1")
        .create();
    RevCommit s2 = side.commit().parent(m1)
        .add("f", "1-master\n2\n3\n4\n5\n6\n7-res(side)\n8\n9-side\n")
        .message("s2(merge)").create();
    master.commit().parent(s1)
        .add("f", "1-master\n2\n3\n4\n5\n6\n7-conflict\n8\n9-side\n")
        .message("m2(merge)").create();
View Full Code Here

public class GcKeepFilesTest extends GcTestCase {
  @Test
  public void testKeepFiles() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    bb.commit().add("A", "A").add("B", "B").create();
    stats = gc.getStatistics();
    assertEquals(4, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
    assertEquals(0, stats.numberOfPackFiles);
    gc.gc();
View Full Code Here

    PackFile singlePack = packIt.next();
    assertFalse(packIt.hasNext());
    File keepFile = new File(singlePack.getPackFile().getPath() + ".keep");
    assertFalse(keepFile.exists());
    assertTrue(keepFile.createNewFile());
    bb.commit().add("A", "A2").add("B", "B2").create();
    stats = gc.getStatistics();
    assertEquals(4, stats.numberOfLooseObjects);
    assertEquals(4, stats.numberOfPackedObjects);
    assertEquals(1, stats.numberOfPackFiles);
    gc.gc();
View Full Code Here

public class GcDirCacheSavesObjectsTest extends GcTestCase {
  @Test
  public void testDirCacheSavesObjects() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    bb.commit().add("A", "A3"); // this new content in index should survive
    stats = gc.getStatistics();
    assertEquals(9, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
View Full Code Here

public class GcDirCacheSavesObjectsTest extends GcTestCase {
  @Test
  public void testDirCacheSavesObjects() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    bb.commit().add("A", "A3"); // this new content in index should survive
    stats = gc.getStatistics();
    assertEquals(9, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
    gc.gc();
View Full Code Here

  @Test
  public void testDirCacheSavesObjects() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    bb.commit().add("A", "A3"); // this new content in index should survive
    stats = gc.getStatistics();
    assertEquals(9, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
    gc.gc();
    stats = gc.getStatistics();
View Full Code Here

  }

  @Test
  public void testDirCacheSavesObjectsWithPruneNow() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    bb.commit().add("A", "A3"); // this new content in index should survive
    stats = gc.getStatistics();
    assertEquals(9, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
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.