* @return the newly created repository, opened for access
* @throws IOException
* the repository could not be created in the temporary area
+ * @since 5.3
*/
- private FileRepository createRepository(boolean bare)
+ protected FileRepository createRepository(boolean bare)
throws IOException {
- return createRepository(bare, true /* auto close */);
+ return createRepository(bare, false /* auto close */);
}
/**
* true to create a bare repository; false to make a repository
* within its working directory
* @param autoClose
- * auto close the repository in #tearDown
+ * auto close the repository in {@link #tearDown()}
* @return the newly created repository, opened for access
* @throws IOException
* the repository could not be created in the temporary area
+ * @deprecated use {@link #createRepository(boolean)} instead
*/
+ @Deprecated
public FileRepository createRepository(boolean bare, boolean autoClose)
throws IOException {
File gitdir = createUniqueTestGitDir(bare);
@Test
public void testFileKeyOpenNew() throws IOException {
File gitdir;
- try (Repository n = createRepository(true, false)) {
+ try (Repository n = createRepository(true)) {
gitdir = n.getDirectory();
}
recursiveDelete(gitdir);
@Test
public void testRepositoryUsageCountWithRegisteredRepository()
throws IOException {
- @SuppressWarnings("resource") // We are testing the close() method
+ @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
Repository repo = createRepository(false, false);
assertEquals(1, repo.useCnt.get());
RepositoryCache.register(repo);
@Test
public void testRepositoryUnregisteringWhenExpired() throws Exception {
- @SuppressWarnings("resource") // We are testing the close() method
+ @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
Repository repoA = createRepository(true, false);
- @SuppressWarnings("resource") // We are testing the close() method
+ @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
Repository repoB = createRepository(true, false);
Repository repoC = createBareRepository();
RepositoryCache.register(repoA);
@Test
public void testReconfigure() throws InterruptedException, IOException {
- @SuppressWarnings("resource") // We are testing the close() method
+ @SuppressWarnings({"resource", "deprecation"}) // We are testing the close() method
Repository repo = createRepository(false, false);
RepositoryCache.register(repo);
assertTrue(RepositoryCache.isCached(repo));