diff --git a/src/shared/local/functions.ts b/src/shared/local/functions.ts index 0a039c54..957146fb 100644 --- a/src/shared/local/functions.ts +++ b/src/shared/local/functions.ts @@ -4,15 +4,12 @@ * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ -import path from 'node:path'; import { WORKDIR, HEAD } from './localShadowRepo'; import { FILE } from './localShadowRepo'; import { StatusRow } from './types'; // filenames were normalized when read from isogit - export const toFilenames = (rows: StatusRow[]): string[] => rows.map((row) => row[FILE]); export const isDeleted = (status: StatusRow): boolean => status[WORKDIR] === 0; export const isAdded = (status: StatusRow): boolean => status[HEAD] === 0 && status[WORKDIR] === 2; -export const ensureWindows = (filepath: string): string => path.win32.normalize(filepath); diff --git a/src/shared/local/localShadowRepo.ts b/src/shared/local/localShadowRepo.ts index fbec5640..896e49c7 100644 --- a/src/shared/local/localShadowRepo.ts +++ b/src/shared/local/localShadowRepo.ts @@ -346,7 +346,7 @@ export class ShadowRepo { if (!matchingFiles.added.size || !matchingFiles.deleted.size) return; const movedFilesMarker = Performance.mark('@salesforce/source-tracking', 'localShadowRepo.detectMovedFiles'); - const matches = await filenameMatchesToMap(IS_WINDOWS)(this.registry)(this.projectPath)(this.gitDir)(matchingFiles); + const matches = await filenameMatchesToMap(this.registry)(this.projectPath)(this.gitDir)(matchingFiles); if (matches.deleteOnly.size === 0 && matches.fullMatches.size === 0) return movedFilesMarker?.stop(); diff --git a/src/shared/local/moveDetection.ts b/src/shared/local/moveDetection.ts index b61cf223..9f823e98 100644 --- a/src/shared/local/moveDetection.ts +++ b/src/shared/local/moveDetection.ts @@ -19,7 +19,7 @@ import * as fs from 'graceful-fs'; import { Performance } from '@oclif/core/performance'; import { isDefined } from '../guards'; import { uniqueArrayConcat } from '../functions'; -import { isDeleted, isAdded, ensureWindows, toFilenames } from './functions'; +import { isDeleted, isAdded, toFilenames } from './functions'; import { AddAndDeleteMaps, DetectionFileInfo, DetectionFileInfoWithType, StatusRow, StringMap } from './types'; const JOIN_CHAR = '#__#'; // the __ makes it unlikely to be used in metadata names @@ -38,15 +38,12 @@ type StringMapsForMatches = { /** composed functions to simplified use by the shadowRepo class */ export const filenameMatchesToMap = - (isWindows: boolean) => (registry: RegistryAccess) => (projectPath: string) => (gitDir: string) => async ({ added, deleted }: AddedAndDeletedFilenames): Promise => { - const resolver = getResolverForFilenames(registry)( - // TODO: use set.union when node 22 is everywhere - isWindows ? uniqueArrayConcat(added, deleted).map(ensureWindows) : uniqueArrayConcat(added, deleted) - ); + // TODO: use set.union when node 22 is everywhere + const resolver = getResolverForFilenames(registry)(uniqueArrayConcat(added, deleted)); return compareHashes( await buildMaps(