aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-04-06 16:04:57 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2016-04-06 16:05:14 +0200
commitf56b9001fc61e50a94a4ae2f7dbb8d4bc9158e82 (patch)
tree9fd69a7f15fc71c77e35491df79feb590354c548 /org.eclipse.jgit.test/tst
parent47dd98e3620d8ae7a8cb4a10361d64fef1c2c085 (diff)
parent74743bc547946bf5730b5caa45645804b2226d35 (diff)
downloadjgit-f56b9001fc61e50a94a4ae2f7dbb8d4bc9158e82.tar.gz
jgit-f56b9001fc61e50a94a4ae2f7dbb8d4bc9158e82.zip
Merge branch 'master' into stable-4.3
* master: Add config parameter gc.prunePackExpire for packfile expiration In TestRepository, use a consistent clock Change-Id: I7ac568e650fbd191e48a8f1a4068af72deb242e8 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java13
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java9
2 files changed, 18 insertions, 4 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java
index f549fb5cdf..41a1a5d3f5 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcBasicPackingTest.java
@@ -213,9 +213,20 @@ public class GcBasicPackingTest extends GcTestCase {
assertEquals(9, stats.numberOfPackedObjects);
assertEquals(2, stats.numberOfPackFiles);
+ // repack again but now without a grace period for loose objects. Since
+ // we don't have loose objects anymore this shouldn't change anything
+ gc.setExpireAgeMillis(0);
+ gc.gc();
+ stats = gc.getStatistics();
+ assertEquals(0, stats.numberOfLooseObjects);
+ // if objects exist in multiple packFiles then they are counted multiple
+ // times
+ assertEquals(9, stats.numberOfPackedObjects);
+ assertEquals(2, stats.numberOfPackFiles);
+
// repack again but now without a grace period for packfiles. We should
// end up with one packfile
- gc.setExpireAgeMillis(0);
+ gc.setPackExpireAgeMillis(0);
gc.gc();
stats = gc.getStatistics();
assertEquals(0, stats.numberOfLooseObjects);
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java
index 5fda070867..49e1f6f3da 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/pack/GcCommitSelectionTest.java
@@ -95,7 +95,8 @@ public class GcCommitSelectionTest extends GcTestCase {
}
currentCommits = nextCommitCount;
- gc.setExpireAgeMillis(0); // immediately delete old packs
+ gc.setPackExpireAgeMillis(0); // immediately delete old packs
+ gc.setExpireAgeMillis(0);
gc.gc();
assertEquals(currentCommits * 3, // commit/tree/object
gc.getStatistics().numberOfPackedObjects);
@@ -158,7 +159,8 @@ public class GcCommitSelectionTest extends GcTestCase {
}
currentCommits = nextCommitCount;
- gc.setExpireAgeMillis(0); // immediately delete old packs
+ gc.setPackExpireAgeMillis(0); // immediately delete old packs
+ gc.setExpireAgeMillis(0);
gc.gc();
assertEquals(currentCommits + " commits: ", expectedBitmapCount,
gc.getStatistics().numberOfBitmaps);
@@ -198,7 +200,8 @@ public class GcCommitSelectionTest extends GcTestCase {
final int commitsForShallowBranches = 100;
// Excessive branch history pruning, one old branch.
- gc.setExpireAgeMillis(0); // immediately delete old packs
+ gc.setPackExpireAgeMillis(0); // immediately delete old packs
+ gc.setExpireAgeMillis(0);
gc.gc();
assertEquals(
commitsForSparseBranch + commitsForFullBranch