mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
fix: skip renaming imported repository
This commit is contained in:
@@ -99,6 +99,11 @@ const migrateRepositoryFolders = async (): Promise<MigrationResult> => {
|
|||||||
|
|
||||||
const config = repo.config as Extract<RepositoryConfig, { backend: "local" }>;
|
const config = repo.config as Extract<RepositoryConfig, { backend: "local" }>;
|
||||||
|
|
||||||
|
if (config.isExistingRepository) {
|
||||||
|
logger.debug(`Skipping imported repository "${repo.name}" - folder path is user-defined`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (config.name === repo.shortId) {
|
if (config.name === repo.shortId) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -367,6 +367,15 @@ const updateRepository = async (name: string, updates: { name?: string; compress
|
|||||||
throw new NotFoundError("Repository not found");
|
throw new NotFoundError("Repository not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
updates.name !== undefined &&
|
||||||
|
updates.name !== existing.name &&
|
||||||
|
existing.config.backend === "local" &&
|
||||||
|
existing.config.isExistingRepository
|
||||||
|
) {
|
||||||
|
throw new ConflictError("Cannot rename an imported local repository");
|
||||||
|
}
|
||||||
|
|
||||||
let newName = existing.name;
|
let newName = existing.name;
|
||||||
if (updates.name !== undefined && updates.name !== existing.name) {
|
if (updates.name !== undefined && updates.name !== existing.name) {
|
||||||
const newSlug = slugify(updates.name, { lower: true, strict: true });
|
const newSlug = slugify(updates.name, { lower: true, strict: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user