mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-12-23 16:59:48 +01:00
Store repository id in git config for each repository
This is needed after migration from v1 to v2 and is done in GitV1UpdateStep.java. Therefore we hat to make the 'forAllPaths' method in PathBasedRepositoryLocationResolver available in the interface of RepositoryLocationResolver.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package sonia.scm.repository;
|
||||
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
public abstract class RepositoryLocationResolver {
|
||||
|
||||
public abstract boolean supportsLocationType(Class<?> type);
|
||||
@@ -35,5 +37,12 @@ public abstract class RepositoryLocationResolver {
|
||||
* @throws IllegalStateException when there already is a location for the given repository registered.
|
||||
*/
|
||||
void setLocation(String repositoryId, T location);
|
||||
|
||||
/**
|
||||
* Iterates all repository locations known to this resolver instance and calls the consumer giving the repository id
|
||||
* and its location for each repository.
|
||||
* @param consumer This callback will be called for each repository with the repository id and its location.
|
||||
*/
|
||||
void forAllLocations(BiConsumer<String, T> consumer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package sonia.scm.update;
|
||||
|
||||
import sonia.scm.repository.Repository;
|
||||
|
||||
/**
|
||||
* Use this in {@link sonia.scm.migration.UpdateStep}s only to read repository objects directly from locations given by
|
||||
* {@link sonia.scm.repository.RepositoryLocationResolver}.
|
||||
*/
|
||||
public interface UpdateStepRepositoryMetadataAccess<T> {
|
||||
Repository read(T location);
|
||||
}
|
||||
Reference in New Issue
Block a user