GarbageCollectCommand: add numberOfBitmaps to statistics

Change-Id: I630afac9408c7313d1cecb1b24476f645c94fc27
Signed-off-by: kylezhao <kylezhao@tencent.com>
This commit is contained in:
kylezhao 2021-09-28 10:48:11 +08:00
parent 4657e7a99a
commit 578b6a79a3
3 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public void testGConeCommit() throws Exception {
Date expire = GitDateParser.parse("now", null, SystemReader
.getInstance().getLocale());
Properties res = git.gc().setExpire(expire).call();
assertTrue(res.size() == 7);
assertTrue(res.size() == 8);
}
@Test
@ -57,6 +57,6 @@ public void testGCmoreCommits() throws Exception {
.setExpire(
GitDateParser.parse("now", null, SystemReader
.getInstance().getLocale())).call();
assertTrue(res.size() == 7);
assertTrue(res.size() == 8);
}
}

View File

@ -324,7 +324,7 @@ public void testPushAfterGC() throws Exception {
// run a gc to ensure we have a bitmap index
Properties res = git1.gc().setExpire(null).call();
assertEquals(7, res.size());
assertEquals(8, res.size());
// create another commit so we have something else to push
writeTrashFile("b", "content of b");

View File

@ -221,6 +221,7 @@ public Properties getStatistics() throws GitAPIException {
@SuppressWarnings("boxing")
private static Properties toProperties(RepoStatistics stats) {
Properties p = new Properties();
p.put("numberOfBitmaps", stats.numberOfBitmaps); //$NON-NLS-1$
p.put("numberOfLooseObjects", stats.numberOfLooseObjects); //$NON-NLS-1$
p.put("numberOfLooseRefs", stats.numberOfLooseRefs); //$NON-NLS-1$
p.put("numberOfPackedObjects", stats.numberOfPackedObjects); //$NON-NLS-1$