From 08e57b9a1990efcd4c4ac7e39bdffdb74362adc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till-Andr=C3=A9=20Diegeler?= Date: Thu, 9 Jan 2025 15:27:22 +0100 Subject: [PATCH] Allow filter for Git repositories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The line `allowfilter = true` is inserted both in new Git repositories and existing ones (via an UpdateStep). This enables clones with `--filter` parameters. Co-authored-by: René Pfeuffer --- gradle/changelog/git-allowfilter-config.yaml | 2 + .../sonia/scm/repository/GitConfigHelper.java | 9 +- ...=> GitRepositoryConfigChangeListener.java} | 4 +- .../update/GitUpdateStepHelper.java | 52 +++++++++ .../repository/update/GitV2UpdateStep.java | 31 +---- .../update/UpdatePackFilterUpdateStep.java | 72 ++++++++++++ .../scm/repository/GitConfigHelperTest.java | 76 ++++++++++++ .../repository/GitRepositoryHandlerTest.java | 29 ++++- .../UpdatePackFilterUpdateStepTest.java | 109 ++++++++++++++++++ .../data/HEAD | 1 + .../data/config | 7 ++ ...2e6b7438d6969e52d7b7f75215a3e58151b4ec.idx | Bin 0 -> 1156 bytes ...e6b7438d6969e52d7b7f75215a3e58151b4ec.pack | Bin 0 -> 921 bytes .../data/refs/heads/main | 1 + .../metadata.xml | 34 ++++++ .../store/config/executedUpdates.xml | 25 ++++ .../store/config/gitConfig.xml | 21 ++++ 17 files changed, 438 insertions(+), 35 deletions(-) create mode 100644 gradle/changelog/git-allowfilter-config.yaml rename scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/{GitRepositoryModifyListener.java => GitRepositoryConfigChangeListener.java} (90%) create mode 100644 scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitUpdateStepHelper.java create mode 100644 scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/UpdatePackFilterUpdateStep.java create mode 100644 scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitConfigHelperTest.java create mode 100644 scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/update/UpdatePackFilterUpdateStepTest.java create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/HEAD create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/config create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.idx create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.pack create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/refs/heads/main create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/metadata.xml create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/executedUpdates.xml create mode 100644 scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/gitConfig.xml diff --git a/gradle/changelog/git-allowfilter-config.yaml b/gradle/changelog/git-allowfilter-config.yaml new file mode 100644 index 0000000000..dcdc33372c --- /dev/null +++ b/gradle/changelog/git-allowfilter-config.yaml @@ -0,0 +1,2 @@ +- type: added + description: Uploadpack.allowFilter = true set for all new and existing Git repositories diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfigHelper.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfigHelper.java index 30a789792d..bcaa3eff89 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfigHelper.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitConfigHelper.java @@ -25,10 +25,11 @@ public class GitConfigHelper { private static final String CONFIG_SECTION_SCMM = "scmm"; private static final String CONFIG_KEY_REPOSITORY_ID = "repositoryid"; - public void createScmmConfig(Repository repository, org.eclipse.jgit.lib.Repository gitRepository) throws IOException { - StoredConfig config = gitRepository.getConfig(); - config.setString(CONFIG_SECTION_SCMM, null, CONFIG_KEY_REPOSITORY_ID, repository.getId()); - config.save(); + public void createScmmConfig(Repository scmmRepository, org.eclipse.jgit.lib.Repository gitRepository) throws IOException { + StoredConfig gitConfig = gitRepository.getConfig(); + gitConfig.setString(CONFIG_SECTION_SCMM, null, CONFIG_KEY_REPOSITORY_ID, scmmRepository.getId()); + gitConfig.setBoolean("uploadpack", null, "allowFilter", true); + gitConfig.save(); } public String getRepositoryId(StoredConfig gitConfig) { diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryConfigChangeListener.java similarity index 90% rename from scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java rename to scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryConfigChangeListener.java index c7eb785ebe..e767eb484b 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryModifyListener.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/GitRepositoryConfigChangeListener.java @@ -30,13 +30,13 @@ import sonia.scm.plugin.Extension; */ @Extension @EagerSingleton -public class GitRepositoryModifyListener { +public class GitRepositoryConfigChangeListener { private final GitHeadModifier headModifier; private final GitRepositoryConfigStoreProvider storeProvider; @Inject - public GitRepositoryModifyListener(GitHeadModifier headModifier, GitRepositoryConfigStoreProvider storeProvider) { + public GitRepositoryConfigChangeListener(GitHeadModifier headModifier, GitRepositoryConfigStoreProvider storeProvider) { this.headModifier = headModifier; this.storeProvider = storeProvider; } diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitUpdateStepHelper.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitUpdateStepHelper.java new file mode 100644 index 0000000000..84c850877b --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitUpdateStepHelper.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 - present Cloudogu GmbH + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ + +package sonia.scm.repository.update; + +import org.eclipse.jgit.storage.file.FileRepositoryBuilder; +import sonia.scm.repository.GitRepositoryHandler; +import sonia.scm.repository.Repository; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +class GitUpdateStepHelper { + + private GitUpdateStepHelper() {} + + static Path determineEffectiveGitFolder(Path path) { + Path bareGitFolder = path.resolve("data"); + Path nonBareGitFolder = bareGitFolder.resolve(".git"); + final Path effectiveGitPath; + if (Files.exists(nonBareGitFolder)) { + effectiveGitPath = nonBareGitFolder; + } else { + effectiveGitPath = bareGitFolder; + } + return effectiveGitPath; + } + + static org.eclipse.jgit.lib.Repository build(File directory) throws IOException { + return new FileRepositoryBuilder().setGitDir(directory).readEnvironment().findGitDir().build(); + } + + static boolean isGitDirectory(Repository repository) { + return GitRepositoryHandler.TYPE_NAME.equals(repository.getType()); + } + +} diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitV2UpdateStep.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitV2UpdateStep.java index 7546cd43d5..7f1f4228d3 100644 --- a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitV2UpdateStep.java +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/GitV2UpdateStep.java @@ -17,22 +17,21 @@ package sonia.scm.repository.update; import jakarta.inject.Inject; -import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import sonia.scm.migration.UpdateException; import sonia.scm.migration.UpdateStep; import sonia.scm.plugin.Extension; import sonia.scm.repository.GitConfigHelper; -import sonia.scm.repository.GitRepositoryHandler; import sonia.scm.repository.Repository; import sonia.scm.repository.RepositoryLocationResolver; import sonia.scm.update.UpdateStepRepositoryMetadataAccess; import sonia.scm.version.Version; -import java.io.File; import java.io.IOException; -import java.nio.file.Files; import java.nio.file.Path; +import static sonia.scm.repository.update.GitUpdateStepHelper.build; +import static sonia.scm.repository.update.GitUpdateStepHelper.determineEffectiveGitFolder; +import static sonia.scm.repository.update.GitUpdateStepHelper.isGitDirectory; import static sonia.scm.version.Version.parse; @Extension @@ -64,30 +63,6 @@ public class GitV2UpdateStep implements UpdateStep { ); } - public Path determineEffectiveGitFolder(Path path) { - Path bareGitFolder = path.resolve("data"); - Path nonBareGitFolder = bareGitFolder.resolve(".git"); - final Path effectiveGitPath; - if (Files.exists(nonBareGitFolder)) { - effectiveGitPath = nonBareGitFolder; - } else { - effectiveGitPath = bareGitFolder; - } - return effectiveGitPath; - } - - private org.eclipse.jgit.lib.Repository build(File directory) throws IOException { - return new FileRepositoryBuilder() - .setGitDir(directory) - .readEnvironment() - .findGitDir() - .build(); - } - - private boolean isGitDirectory(Repository repository) { - return GitRepositoryHandler.TYPE_NAME.equals(repository.getType()); - } - @Override public Version getTargetVersion() { return parse("2.0.0"); diff --git a/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/UpdatePackFilterUpdateStep.java b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/UpdatePackFilterUpdateStep.java new file mode 100644 index 0000000000..181de2e30b --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/main/java/sonia/scm/repository/update/UpdatePackFilterUpdateStep.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 - present Cloudogu GmbH + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ + +package sonia.scm.repository.update; + +import jakarta.inject.Inject; +import sonia.scm.migration.RepositoryUpdateContext; +import sonia.scm.migration.RepositoryUpdateStep; +import sonia.scm.plugin.Extension; +import sonia.scm.repository.GitConfigHelper; +import sonia.scm.repository.Repository; +import sonia.scm.repository.RepositoryLocationResolver; +import sonia.scm.update.UpdateStepRepositoryMetadataAccess; +import sonia.scm.version.Version; + +import java.io.File; +import java.nio.file.Path; + +import static sonia.scm.repository.update.GitUpdateStepHelper.build; +import static sonia.scm.repository.update.GitUpdateStepHelper.determineEffectiveGitFolder; +import static sonia.scm.repository.update.GitUpdateStepHelper.isGitDirectory; +import static sonia.scm.version.Version.parse; + +@Extension +public class UpdatePackFilterUpdateStep implements RepositoryUpdateStep { + + private final RepositoryLocationResolver locationResolver; + private final UpdateStepRepositoryMetadataAccess repositoryMetadataAccess; + + @Inject + public UpdatePackFilterUpdateStep(RepositoryLocationResolver locationResolver, UpdateStepRepositoryMetadataAccess repositoryMetadataAccess) { + this.locationResolver = locationResolver; + this.repositoryMetadataAccess = repositoryMetadataAccess; + } + + @Override + public void doUpdate(RepositoryUpdateContext repositoryUpdateContext) throws Exception { + Path scmmRepositoryLocation = locationResolver.forClass(Path.class).getLocation(repositoryUpdateContext.getRepositoryId()); + Repository scmmRepository = repositoryMetadataAccess.read(scmmRepositoryLocation); + + if (isGitDirectory(scmmRepository)) { + File gitFile = determineEffectiveGitFolder(scmmRepositoryLocation).toFile(); + org.eclipse.jgit.lib.Repository gitRepository = build(gitFile); + GitConfigHelper gitConfigHelper = new GitConfigHelper(); + gitConfigHelper.createScmmConfig(scmmRepository, gitRepository); + } + } + + @Override + public Version getTargetVersion() { + return parse("3.7.0"); + } + + @Override + public String getAffectedDataType() { + return "sonia.scm.plugin.git"; + } + +} diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitConfigHelperTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitConfigHelperTest.java new file mode 100644 index 0000000000..ca0ef486fd --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitConfigHelperTest.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 - present Cloudogu GmbH + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ + +package sonia.scm.repository; + +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.lib.StoredConfig; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.io.IOException; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.doReturn; + +@ExtendWith(MockitoExtension.class) +class GitConfigHelperTest { + @Mock + Repository gitRepository; + + StoredConfig gitConfig; + + sonia.scm.repository.Repository scmmRepository; + + @BeforeEach + void setUp() { + gitConfig = new StoredConfig() { + @Override + public void load() { + // not needed + } + + @Override + public void save() { + // not needed + } + }; + doReturn(gitConfig).when(gitRepository).getConfig(); + + scmmRepository = RepositoryTestData.createHeartOfGold(); + } + + @Test + void shouldSetCorrectScmmRepositoryId() throws IOException { + GitConfigHelper target = new GitConfigHelper(); + + target.createScmmConfig(scmmRepository, gitRepository); + + assertThat(gitConfig.getString("scmm", null, "repositoryid")).isEqualTo(scmmRepository.getId()); + } + + @Test + void shouldAllowUploadpackFilter() throws IOException { + GitConfigHelper target = new GitConfigHelper(); + + target.createScmmConfig(scmmRepository, gitRepository); + + assertThat(gitConfig.getBoolean("uploadpack", "allowFilter", false)).isTrue(); + } +} diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java index 9c0ed22916..5ef2757fd1 100644 --- a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/GitRepositoryHandlerTest.java @@ -23,8 +23,12 @@ import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import sonia.scm.schedule.Scheduler; import sonia.scm.store.ConfigurationStoreFactory; +import sonia.scm.store.InMemoryByteConfigurationStoreFactory; +import java.io.BufferedReader; import java.io.File; +import java.io.FileReader; +import java.nio.file.Path; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; @@ -79,7 +83,6 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { GitConfig config = new GitConfig(); - // TODO fix event bus exception repositoryHandler.setConfig(config); return repositoryHandler; @@ -116,4 +119,28 @@ public class GitRepositoryHandlerTest extends SimpleRepositoryHandlerTestBase { assertThat(new File(nativeRepoDirectory, "HEAD")).hasContent("ref: refs/heads/other"); } + + @Test + public void shouldSetAllowFilterConfigByDefault() throws Exception{ + ConfigurationStoreFactory configurationStoreFactory = new InMemoryByteConfigurationStoreFactory(); + + GitRepositoryHandler repositoryHandler = new GitRepositoryHandler(configurationStoreFactory, + scheduler, repositoryLocationResolver, gitWorkingCopyFactory,null); + GitConfig config = new GitConfig(); + + repositoryHandler.setConfig(config); + repositoryHandler.create(RepositoryTestData.createHeartOfGold("git")); + + Path repositoryPath = repositoryLocationResolver.forClass(Path.class).getLocation(""); + File configFile = repositoryPath.resolve("data/config").toFile(); + + boolean containsAllowFilter = false; + try (BufferedReader br = new BufferedReader(new FileReader(configFile.getAbsolutePath()))) { + do { + String line = br.readLine(); + containsAllowFilter |= line.contains("allowFilter") && line.contains("true"); + } while (br.readLine() != null); + } + assertTrue(containsAllowFilter); + } } diff --git a/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/update/UpdatePackFilterUpdateStepTest.java b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/update/UpdatePackFilterUpdateStepTest.java new file mode 100644 index 0000000000..3b3ddbe241 --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/java/sonia/scm/repository/update/UpdatePackFilterUpdateStepTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2020 - present Cloudogu GmbH + * + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU Affero General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more + * details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ + +package sonia.scm.repository.update; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.io.TempDir; +import org.mockito.junit.jupiter.MockitoExtension; +import sonia.scm.TempDirRepositoryLocationResolver; +import sonia.scm.migration.RepositoryUpdateContext; +import sonia.scm.repository.Repository; +import sonia.scm.repository.RepositoryLocationResolver; +import sonia.scm.repository.RepositoryTestData; +import sonia.scm.update.UpdateStepRepositoryMetadataAccess; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.stream.Stream; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.io.CleanupMode.ALWAYS; + +@ExtendWith(MockitoExtension.class) +class UpdatePackFilterUpdateStepTest { + + RepositoryLocationResolver repositoryLocationResolver; + + UpdateStepRepositoryMetadataAccess updateStepRepositoryMetadataAccess; + + @Nested + class DoUpdate { + + @TempDir(cleanup = ALWAYS) + Path tempDir; + + UpdatePackFilterUpdateStep target; + + private static final String EXAMPLE_REPOSITORY_ID = "3ZUZMNJn3E"; + + @BeforeEach + void setUp() throws IOException { + String sourcePath = "src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate"; + loadFilesIntoTempDir(tempDir, sourcePath); + + repositoryLocationResolver = new TempDirRepositoryLocationResolver(tempDir.toFile()); + updateStepRepositoryMetadataAccess = location -> { + Repository repository = RepositoryTestData.createRestaurantAtTheEndOfTheUniverse("git"); + repository.setId(EXAMPLE_REPOSITORY_ID); + return repository; + }; + } + + @Test + void shouldWriteAllowFilterLineWithinConfig() throws Exception { + target = new UpdatePackFilterUpdateStep(repositoryLocationResolver, updateStepRepositoryMetadataAccess); + + target.doUpdate(new RepositoryUpdateContext(EXAMPLE_REPOSITORY_ID)); + + File configFile = tempDir.resolve("data/config").toFile(); + + boolean containsAllowFilter = false; + try (BufferedReader br = new BufferedReader(new FileReader(configFile.getAbsolutePath()))) { + do { + String line = br.readLine(); + containsAllowFilter |= line.contains("allowFilter") && line.contains("true"); + } while (br.readLine() != null); + } + assertTrue(containsAllowFilter); + } + } + + private void loadFilesIntoTempDir(Path tempDir, String sourcePath) throws IOException { + File repositorySourcePath = new File(sourcePath); + try (Stream sources = Files.walk(repositorySourcePath.toPath())) { + sources.forEach(source -> { + Path destination = Paths.get(tempDir.toString(), source.toString().substring(repositorySourcePath.toString().length())); + if (!destination.toFile().exists()) { + try { + Files.copy(source, destination); + } catch (IOException e) { + fail("An exception occurred during temporary repository file setup.", e); + } + } + }); + } + } +} diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/HEAD b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/HEAD new file mode 100644 index 0000000000..b870d82622 --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/HEAD @@ -0,0 +1 @@ +ref: refs/heads/main diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/config b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/config new file mode 100644 index 0000000000..3a3200072a --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/config @@ -0,0 +1,7 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true + logallrefupdates = false +[scmm] + repositoryid = 3ZUZMNJn3E diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.idx b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.idx new file mode 100644 index 0000000000000000000000000000000000000000..42f2125f3d1e3fe779d64ff4c6327a816b330b2f GIT binary patch literal 1156 zcmexg;-AdGz`z8=qW}>Cj6f!-7!-!1cr*-#S{h&mrdwv`$vTF27k1pTxS7^;mG`69 z6!!3W0cDa`U*DGu9g(%QuR`FWN^ K9_uof^5p=Ok3VAo literal 0 HcmV?d00001 diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.pack b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/objects/pack/pack-242e6b7438d6969e52d7b7f75215a3e58151b4ec.pack new file mode 100644 index 0000000000000000000000000000000000000000..72d37156cb1e5a6a1f2dce40d481a05f3cba41ec GIT binary patch literal 921 zcmV;K17`eCK|@Ob00062000A#LU^2|(@E2+MihYIJ-?#&)D4qNsU-D*BDBgNgP*WT zVKX&@jZBKaKHg+|cR9;vaTce}I}LdbL{^qKH52n&hUARR3pwWzC*5R(HoU^+QYuM` z%pxkCr-}?9*xEqLI(*0DG^Eo<{uoi0{**7&k~t&g{2Lq3UrWlq9B~PL{2bjdp#wbA0|7K0EsT8QU#Gw&A4W{>zXN^inPBnjMBVE%R}>@=BvE2|2x|9u9C% z0lTZLN=nDYcv)pi^c6GF*uRULQ403m$NkCFk5bwqRnTspB}JPv+Sns4?U2wnbVh+C zGPP5|#Lr!?(+LitwSyx$yZdXJc0qnsFAY(e_=10t4R- z_h-@8N-Ts9{dR36j%q1=Cn%Io(?z_Ckv8VB_PN)}T@14=nc_+0QyiPvA^`=SrNpS# z#rjyIREByqyl)Z8LPWc$|B4FYH*o+S%s&P@TG3ezjTMA||9jPb;=)f0x96ILW>l zP(p5dCPQ<-p!6D~0xllk9T6K-usOFMZwe+NR zFWJhLTWbk~`>d;06NuazLDSIS?Od?W@S#Txt&ElyrOILZ`AIk?7|!lj!BC$RC!DtUor59o$%sEuuKxfrB}~<&0(hJ=G%zqTF;NI|b#(D{ z)yqv`_*XKs^>+o|^N+Ljo&bAk>$u( literal 0 HcmV?d00001 diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/refs/heads/main b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/refs/heads/main new file mode 100644 index 0000000000..ff4d480a8d --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/data/refs/heads/main @@ -0,0 +1 @@ +43932c31dda188da38d96682d50df14a9407579e diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/metadata.xml b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/metadata.xml new file mode 100644 index 0000000000..8a4d51d25f --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/metadata.xml @@ -0,0 +1,34 @@ + + + + + + 3ZUZMNJn3E + test + exampleGitRepoWithoutFilterUpdate + git + + + 1736402353654 + 1736402353753 + + false + scmadmin + OWNER + + false + diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/executedUpdates.xml b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/executedUpdates.xml new file mode 100644 index 0000000000..0b1a49a777 --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/executedUpdates.xml @@ -0,0 +1,25 @@ + + + + + + sonia.scm.dao.xml + + 2.0.0 + + + diff --git a/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/gitConfig.xml b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/gitConfig.xml new file mode 100644 index 0000000000..9b3ac72cc5 --- /dev/null +++ b/scm-plugins/scm-git-plugin/src/test/resources/scm-home/repositories/exampleGitRepoWithoutFilterUpdate/store/config/gitConfig.xml @@ -0,0 +1,21 @@ + + + + + main + false +