예제 #1
0
  @Test
  public void testCollectionWithGarbageNoCoalescence() throws Exception {
    RevCommit commit0 = commit().message("0").create();
    RevCommit commit1 = commit().message("1").parent(commit0).create();
    git.update("master", commit0);

    for (int i = 0; i < 3; i++) {
      commit1 = commit().message("g" + i).parent(commit1).create();

      DfsGarbageCollector gc = new DfsGarbageCollector(repo);
      gc.setCoalesceGarbageLimit(0);
      gc.setGarbageTtl(0, TimeUnit.MILLISECONDS);
      run(gc);
      assertEquals(1 + i, countPacks(UNREACHABLE_GARBAGE));
    }
  }