Package org.eclipse.jgit.junit.TestRepository

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


  @Test
  public void testPackCommitsAndLooseOneWithPruneNowNoReflog()
      throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    tr.update("refs/heads/master", first);

    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
View Full Code Here


  @Test
  public void testPackCommitsAndLooseOneWithPruneNowNoReflog()
      throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    tr.update("refs/heads/master", first);

    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
View Full Code Here

  public void testInitialCheckout() throws Exception {
    Git git = new Git(db);

    TestRepository<Repository> db_t = new TestRepository<Repository>(db);
    BranchBuilder master = db_t.branch("master");
    master.commit().add("f", "1").message("m0").create();
    assertFalse(new File(db.getWorkTree(), "f").exists());
    git.checkout().setName("master").call();
    assertTrue(new File(db.getWorkTree(), "f").exists());
  }
View Full Code Here

  }

  @Test
  public void testPackCommitsAndLooseOneWithPruneNow() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    tr.update("refs/heads/master", first);

    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
View Full Code Here

  @Test
  public void testPackCommitsAndLooseOneWithPruneNow() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/master");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    tr.update("refs/heads/master", first);

    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
    assertEquals(0, stats.numberOfPackedObjects);
View Full Code Here

      WorktreeState worktreeState) throws Exception {
    if (!validateStates(indexState, worktreeState))
      return;
    // fill the repo
    BranchBuilder master = db_t.branch("master");
    RevCommit m0 = master.commit().add("m", ",m0").message("m0").create();
    RevCommit m1 = master.commit().add("m", "m1").message("m1").create();
    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0).add("s", "s1").message("s1")
View Full Code Here

    if (!validateStates(indexState, worktreeState))
      return;
    // fill the repo
    BranchBuilder master = db_t.branch("master");
    RevCommit m0 = master.commit().add("m", ",m0").message("m0").create();
    RevCommit m1 = master.commit().add("m", "m1").message("m1").create();
    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0).add("s", "s1").message("s1")
        .create();
View Full Code Here

    RevCommit m0 = master.commit().add("m", ",m0").message("m0").create();
    RevCommit m1 = master.commit().add("m", "m1").message("m1").create();
    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0).add("s", "s1").message("s1")
        .create();
    RevCommit s2 = side.commit().parent(m1).add("m", "m1")
        .message("s2(merge)").create();
    RevCommit m2 = master.commit().parent(s1).add("s", "s1")
        .message("m2(merge)").create();
View Full Code Here

    db_t.getRevWalk().parseCommit(m1);

    BranchBuilder side = db_t.branch("side");
    RevCommit s1 = side.commit().parent(m0).add("s", "s1").message("s1")
        .create();
    RevCommit s2 = side.commit().parent(m1).add("m", "m1")
        .message("s2(merge)").create();
    RevCommit m2 = master.commit().parent(s1).add("s", "s1")
        .message("m2(merge)").create();

    Git git = Git.wrap(db);
View Full Code Here

      throws Exception {
    if (!validateStates(indexState, worktreeState))
      return;

    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

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.