]> source.dussan.org Git - jgit.git/commitdiff
LocalDiskRepositoryTestCase: Only add to toClose through access method 63/89663/2
authorDavid Pursehouse <david.pursehouse@gmail.com>
Fri, 27 Jan 2017 03:05:12 +0000 (12:05 +0900)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 28 Jan 2017 16:46:27 +0000 (17:46 +0100)
Only using the access method means we only have one place where the
toClose set is modified, making it easier to debug either by adding
log statements or by setting a breakpoint.

Change-Id: I4f9f1774d5f2e10bcab381edfd84bb6ee0499a11
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java

index 0a6defc3e250bc60e8e30e8de296fafaa6b9d87e..42e201e932e48f8ce7f843b4279729aa257baec7 100644 (file)
@@ -364,7 +364,7 @@ public abstract class LocalDiskRepositoryTestCase {
                FileRepository db = new FileRepository(gitdir);
                assertFalse(gitdir.exists());
                db.create(bare);
-               toClose.add(db);
+               addRepoToClose(db);
                return db;
        }