Skip to content

Commit

Permalink
chore: return order consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
iowillhoit committed May 13, 2024
1 parent 127e640 commit 6bb7217
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/shared/localShadowRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ export class ShadowRepo {
}

private async detectMovedFiles(): Promise<void> {
const { deletedFilenamesWithMatches, addedFilenamesWithMatches } = getMatches(await this.getStatus()) ?? {};
if (!deletedFilenamesWithMatches || !addedFilenamesWithMatches) return;
const { addedFilenamesWithMatches, deletedFilenamesWithMatches } = getMatches(await this.getStatus()) ?? {};
if (!addedFilenamesWithMatches || !deletedFilenamesWithMatches) return;

const movedFilesMarker = Performance.mark('@salesforce/source-tracking', 'localShadowRepo.detectMovedFiles');

Expand Down Expand Up @@ -412,7 +412,7 @@ export class ShadowRepo {
this.logger.debug(
[
'Files have moved. Committing moved files:',
[...matches.entries()].map(([del, add]) => `- File ${add} was moved to ${del}`).join(os.EOL),
[...matches.entries()].map(([add, del]) => `- File ${del} was moved to ${add}`).join(os.EOL),
].join(os.EOL)
);

Expand Down Expand Up @@ -485,7 +485,7 @@ const getMatches = (
const addedFilenamesWithMatches = addedFilenames.filter((f) => deletedBasenames.has(path.basename(f)));
if (!addedFilenamesWithMatches.length) return;

return { deletedFilenamesWithMatches, addedFilenamesWithMatches };
return { addedFilenamesWithMatches, deletedFilenamesWithMatches };
};

const isDeleted = (status: StatusRow): boolean => status[WORKDIR] === 0;
Expand Down

0 comments on commit 6bb7217

Please sign in to comment.