LocalDiskRepositoryTestCase: Only add to toClose through access method

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>
This commit is contained in:
David Pursehouse 2017-01-27 12:05:12 +09:00 committed by Matthias Sohn
parent a9a3af4af7
commit 5d0ca36d39
1 changed files with 1 additions and 1 deletions

View File

@ -364,7 +364,7 @@ private FileRepository createRepository(boolean bare) throws IOException {
FileRepository db = new FileRepository(gitdir);
assertFalse(gitdir.exists());
db.create(bare);
toClose.add(db);
addRepoToClose(db);
return db;
}