Fix LocalDiskRepositoryTestCase to create correct type of repos

In one place LocalDiskRepositoryTestCase was ignoring the specification
whether to create a bare or non-bare repository. Fix this and fix also
one test which fails now because bare repos don't write reflogs by
default.

Change-Id: I4bcf8cf97c5b46e2f3919809eaa121a8d0e47010
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Christian Halstrick 2014-12-12 00:59:06 +01:00 committed by Matthias Sohn
parent 42b20d4127
commit 35c00a7a73
2 changed files with 6 additions and 1 deletions

View File

@ -84,6 +84,7 @@
import org.eclipse.jgit.junit.TestRng;
import org.eclipse.jgit.junit.http.AccessEvent;
import org.eclipse.jgit.junit.http.HttpTestCase;
import org.eclipse.jgit.lib.ConfigConstants;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.NullProgressMonitor;
import org.eclipse.jgit.lib.ObjectId;
@ -143,6 +144,10 @@ public void setUp() throws Exception {
final TestRepository<Repository> src = createTestRepository();
final String srcName = src.getRepository().getDirectory().getName();
src.getRepository()
.getConfig()
.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
ConfigConstants.CONFIG_KEY_LOGALLREFUPDATES, true);
ServletContextHandler app = server.addContext("/git");
GitServlet gs = new GitServlet();

View File

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