@@ -5,7 +5,7 @@ import { StatusBarManager, SyncStatus } from './statusBarManager';
55import { Logger } from './utils/logger' ;
66import { NotificationManager } from './utils/notifications' ;
77import { GitApiManager , GitTreeItem } from './utils/gitProvider' ;
8- import { encodeRepositorySlug , isLegacySlug , migrateLegacySlug } from './storage/repositoryStorage' ;
8+ import { encodeRepositorySlug } from './storage/repositoryStorage' ;
99import { GitProviderFactory } from './utils/gitProviderFactory' ;
1010import { FileSystemManager } from './utils/fileSystem' ;
1111import { AzureDevOpsApiManager } from './utils/azureDevOps' ;
@@ -687,74 +687,12 @@ export class SyncManager {
687687 } else {
688688 this . logger . debug ( 'No repository storage to migrate' ) ;
689689 }
690-
691- // Migrate legacy underscore-based slugs to base64url format
692- await this . migrateLegacySlugs ( ) ;
693690 } catch ( error ) {
694691 this . logger . error ( 'Error during repository storage migration' , error instanceof Error ? error : undefined ) ;
695692 // Don't throw - allow extension to continue even if migration fails
696693 }
697694 }
698695
699- /**
700- * Migrate legacy underscore-based repository slugs to base64url format
701- */
702- private async migrateLegacySlugs ( ) : Promise < void > {
703- try {
704- if ( ! await this . fileSystem . directoryExists ( this . repoStorageDir ) ) {
705- this . logger . debug ( 'No repository storage directory, skipping legacy slug migration' ) ;
706- return ;
707- }
708-
709- const fs = require ( 'fs' ) . promises ;
710- const entries = await fs . readdir ( this . repoStorageDir , { withFileTypes : true } ) ;
711-
712- let migratedCount = 0 ;
713-
714- for ( const entry of entries ) {
715- if ( ! entry . isDirectory ( ) ) {
716- continue ;
717- }
718-
719- const oldSlug = entry . name ;
720-
721- // Check if this is a legacy slug
722- if ( ! isLegacySlug ( oldSlug ) ) {
723- continue ;
724- }
725-
726- try {
727- // Convert to new base64url slug
728- const newSlug = migrateLegacySlug ( oldSlug ) ;
729- const oldPath = path . join ( this . repoStorageDir , oldSlug ) ;
730- const newPath = path . join ( this . repoStorageDir , newSlug ) ;
731-
732- // Check if new path already exists (avoid overwriting)
733- if ( await this . fileSystem . directoryExists ( newPath ) ) {
734- this . logger . warn ( `Skipping migration of ${ oldSlug } : target ${ newSlug } already exists` ) ;
735- continue ;
736- }
737-
738- // Rename directory
739- await fs . rename ( oldPath , newPath ) ;
740- migratedCount ++ ;
741- this . logger . info ( `Migrated legacy slug: ${ oldSlug } -> ${ newSlug } ` ) ;
742- } catch ( error ) {
743- this . logger . error ( `Failed to migrate legacy slug ${ oldSlug } ` , error instanceof Error ? error : undefined ) ;
744- }
745- }
746-
747- if ( migratedCount > 0 ) {
748- this . logger . info ( `Successfully migrated ${ migratedCount } legacy repository slug(s) to base64url format` ) ;
749- } else {
750- this . logger . debug ( 'No legacy slugs found to migrate' ) ;
751- }
752- } catch ( error ) {
753- this . logger . error ( 'Error during legacy slug migration' , error instanceof Error ? error : undefined ) ;
754- // Don't throw - allow extension to continue even if migration fails
755- }
756- }
757-
758696 /**
759697 * Get the storage path for a specific repository
760698 */
0 commit comments