summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2023-03-03 16:02:49 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-03-03 16:02:49 +0100
commitcd72ecbc072fc07b924c034330610d4215549d68 (patch)
tree0b344291fa730c3ff0f52a17b3bea83070f875e8 /org.eclipse.jgit.test/tst
parentf4eda3360a637beb3bc172810d9f9d3abec4360c (diff)
parent9dd912a1c2f288bfc27b2753a017277067801548 (diff)
downloadjgit-cd72ecbc072fc07b924c034330610d4215549d68.tar.gz
jgit-cd72ecbc072fc07b924c034330610d4215549d68.zip
Merge branch 'stable-6.3' into stable-6.4
* stable-6.3: Improve test coverage when core.trustPackedRefsStat set to after_open Change-Id: I236c5cbb638493cc4b23475be50d0f724d62a688
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderAfterOpenConfigTest.java32
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryAfterOpenConfigTest.java30
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java3
3 files changed, 65 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderAfterOpenConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderAfterOpenConfigTest.java
new file mode 100644
index 0000000000..100bd32ad8
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileRepositoryBuilderAfterOpenConfigTest.java
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc.
+ * and other copyright owners as documented in the project's IP log.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package org.eclipse.jgit.internal.storage.file;
+
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.eclipse.jgit.lib.CoreConfig;
+import org.eclipse.jgit.lib.StoredConfig;
+import org.eclipse.jgit.util.SystemReader;
+import org.junit.Before;
+
+public class FileRepositoryBuilderAfterOpenConfigTest extends FileRepositoryBuilderTest {
+ /** {@inheritDoc} */
+ @Before
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ StoredConfig userConfig = SystemReader.getInstance().getUserConfig();
+ userConfig.setEnum(ConfigConstants.CONFIG_CORE_SECTION, null,
+ ConfigConstants.CONFIG_KEY_TRUST_PACKED_REFS_STAT,
+ CoreConfig.TrustPackedRefsStat.AFTER_OPEN);
+ userConfig.save();
+ }
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryAfterOpenConfigTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryAfterOpenConfigTest.java
new file mode 100644
index 0000000000..42304e2253
--- /dev/null
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryAfterOpenConfigTest.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc.
+ * and other copyright owners as documented in the project's IP log.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Distribution License v. 1.0 which is available at
+ * https://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+package org.eclipse.jgit.internal.storage.file;
+
+import org.eclipse.jgit.lib.ConfigConstants;
+import org.eclipse.jgit.lib.CoreConfig;
+import org.eclipse.jgit.lib.StoredConfig;
+import org.eclipse.jgit.util.SystemReader;
+
+public class RefDirectoryAfterOpenConfigTest extends RefDirectoryTest {
+ /** {@inheritDoc} */
+ @Override
+ public void refDirectorySetup() throws Exception {
+ StoredConfig userConfig = SystemReader.getInstance().getUserConfig();
+ userConfig.setEnum(ConfigConstants.CONFIG_CORE_SECTION, null,
+ ConfigConstants.CONFIG_KEY_TRUST_PACKED_REFS_STAT,
+ CoreConfig.TrustPackedRefsStat.AFTER_OPEN);
+ userConfig.save();
+ super.refDirectorySetup();
+ }
+}
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
index 38c545ef57..4b80f18970 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/RefDirectoryTest.java
@@ -72,7 +72,10 @@ public class RefDirectoryTest extends LocalDiskRepositoryTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
+ refDirectorySetup();
+ }
+ public void refDirectorySetup() throws Exception {
diskRepo = createBareRepository();
refdir = (RefDirectory) diskRepo.getRefDatabase();