Package org.eclipse.jgit.junit.TestRepository

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


  @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);
    gc.setExpireAgeMillis(0);
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);
    gc.setExpireAgeMillis(0);
    fsTick();
View Full Code Here

  }

  @Test
  public void dontPackHEAD_nonBare() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/side");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    Git git = Git.wrap(repo);

    // check for the unborn branch master. HEAD should point to master and
    // master doesn't exist.
View Full Code Here

  @Test
  public void dontPackHEAD_nonBare() throws Exception {
    BranchBuilder bb = tr.branch("refs/heads/side");
    RevCommit first = bb.commit().add("A", "A").add("B", "B").create();
    bb.commit().add("A", "A2").add("B", "B2").create();
    Git git = Git.wrap(repo);

    // check for the unborn branch master. HEAD should point to master and
    // master doesn't exist.
    assertEquals(repo.getRef("HEAD").getTarget().getName(),
View Full Code Here

  }

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

    // Convert the repo to be bare
    FileBasedConfig cfg = repo.getConfig();
    cfg.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
View Full Code Here

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

    // Convert the repo to be bare
    FileBasedConfig cfg = repo.getConfig();
    cfg.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
        ConfigConstants.CONFIG_KEY_BARE, true);
View Full Code Here

public class GcReflogTest extends GcTestCase {
  @Test
  public void testPruneNone() 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();
    new File(repo.getDirectory(), Constants.LOGS + "/refs/heads/master")
        .delete();
    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
View Full Code Here

public class GcReflogTest extends GcTestCase {
  @Test
  public void testPruneNone() 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();
    new File(repo.getDirectory(), Constants.LOGS + "/refs/heads/master")
        .delete();
    stats = gc.getStatistics();
    assertEquals(8, stats.numberOfLooseObjects);
    gc.setExpireAgeMillis(0);
View Full Code Here

  }

  @Test
  public void testPackCommitsAndLooseOneNoReflog() 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 testPackCommitsAndLooseOneNoReflog() 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

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.