public void nonReferencedExpiredObject_pruned() throws Exception {
RevBlob a = tr.blob("a");
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertFalse(repo.hasObject(a));
}
RevBlob a = tr.blob("a");
RevTree t = tr.tree(tr.file("a", a));
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertFalse(repo.hasObject(t));
assertFalse(repo.hasObject(a));
RevBlob a = tr.blob("a");
tr.lightweightTag("t", a);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertTrue(repo.hasObject(a));
}
tr.lightweightTag("t", t);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertTrue(repo.hasObject(t));
assertTrue(repo.hasObject(a));
RevCommit tip = commitChain(10);
tr.branch("b").update(tip);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
do {
assertTrue(repo.hasObject(tip));
update.setForceUpdate(true);
update.delete();
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertTrue(gc.getStatistics().numberOfLooseObjects == 0);
}
update.delete();
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
assertTrue(repo.hasObject(b2Tip));
}
assertEquals(0, stats.numberOfPackedObjects);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.gc();
stats = gc.getStatistics();
assertEquals(0, stats.numberOfLooseObjects);
assertEquals(8, stats.numberOfLooseObjects);
assertEquals(0, stats.numberOfPackedObjects);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.gc();
stats = gc.getStatistics();
assertEquals(0, stats.numberOfLooseObjects);
assertEquals(9, stats.numberOfLooseObjects);
assertEquals(0, stats.numberOfPackedObjects);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.gc();
stats = gc.getStatistics();
assertEquals(0, stats.numberOfLooseObjects);
stats = gc.getStatistics();
assertEquals(8, stats.numberOfLooseObjects);
gc.setExpireAgeMillis(0);
+ fsTick();
gc.prune(Collections.<ObjectId> emptySet());
stats = gc.getStatistics();
assertEquals(8, stats.numberOfLooseObjects);