]> source.dussan.org Git - jgit.git/commit
Fix loop in auto gc 28/84628/1
authorMatthias Sohn <matthias.sohn@sap.com>
Mon, 7 Nov 2016 21:31:10 +0000 (22:31 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Mon, 7 Nov 2016 21:31:10 +0000 (22:31 +0100)
commitf8ac03459a96138cc9cf8578933a946fb1f179f3
tree77e967b10aa6d8ee391511154bfadbd7368a2a70
parent23135e328003b21e95311421a0887f2dadaa4b70
Fix loop in auto gc

* GC.tooManyLooseObjects() always responded true since the loop missed
to advance the iterator so it always incremented until the threshold was
exceeded.
* Also fix loop exit criterion which was off by 1.
* Add some tests.

Change-Id: I70976dfaa026efbcf3c46bd45941f37277a18e04
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AutoGcTest.java [new file with mode: 0644]
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcTestCase.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/test/resources/SampleDataRepositoryTestCase.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java