From 35c00a7a73399aafd6d71acb786387a6d558e2b4 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Fri, 12 Dec 2014 00:59:06 +0100 Subject: [PATCH] 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 --- .../eclipse/jgit/http/test/SmartClientSmartServerTest.java | 5 +++++ .../org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java index bb612b1a6..4e75a5632 100644 --- a/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java +++ b/org.eclipse.jgit.http.test/tst/org/eclipse/jgit/http/test/SmartClientSmartServerTest.java @@ -84,6 +84,7 @@ import org.eclipse.jgit.junit.TestRepository; 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 class SmartClientSmartServerTest extends HttpTestCase { final TestRepository 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(); diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java index 053751f8a..b98db7d18 100644 --- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java +++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java @@ -265,7 +265,7 @@ public abstract class LocalDiskRepositoryTestCase { File gitdir = createUniqueTestGitDir(bare); FileRepository db = new FileRepository(gitdir); assertFalse(gitdir.exists()); - db.create(); + db.create(bare); toClose.add(db); return db; }