Skip to content

Commit 38c93da

Browse files
committed
fix: readBlob must be posix
1 parent c6f54ab commit 38c93da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/shared/local/moveDetection.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as fs from 'graceful-fs';
1919
import { Performance } from '@oclif/core/performance';
2020
import { isDefined } from '../guards';
2121
import { uniqueArrayConcat } from '../functions';
22-
import { isDeleted, isAdded, toFilenames } from './functions';
22+
import { isDeleted, isAdded, toFilenames, IS_WINDOWS, ensurePosix } from './functions';
2323
import { AddAndDeleteMaps, DetectionFileInfo, DetectionFileInfoWithType, StatusRow, StringMap } from './types';
2424

2525
const JOIN_CHAR = '#__#'; // the __ makes it unlikely to be used in metadata names
@@ -242,7 +242,9 @@ const getHashFromActualFileContents =
242242
async (filepath: string): Promise<DetectionFileInfo> => ({
243243
filename: filepath,
244244
basename: path.basename(filepath),
245-
hash: (await git.readBlob({ fs, dir: projectPath, gitdir, filepath, oid })).oid,
245+
hash: (
246+
await git.readBlob({ fs, dir: projectPath, gitdir, filepath: IS_WINDOWS ? ensurePosix(filepath) : filepath, oid })
247+
).oid,
246248
});
247249

248250
export const toKey = (input: DetectionFileInfoWithType): string =>

0 commit comments

Comments
 (0)