Skip to content

Commit 05f6f4a

Browse files
committed
fix: use isFileInFolder for cross-platform opaque whiteout dir matching
isFileInOpaqueDir was using path.dirname and path.sep directly, which breaks on Windows where path.sep is \ but Docker paths use /. Reuse the existing isFileInFolder helper which normalizes paths first — same pattern as isFileInARemovedFolder.
1 parent cb73d68 commit 05f6f4a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lib/extractor/index.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,9 @@ function isFileInOpaqueDir(
310310
filename: string,
311311
opaqueWhiteoutDirs: Set<string>,
312312
): boolean {
313-
const dir = path.dirname(filename);
314-
for (const opaqueDir of opaqueWhiteoutDirs) {
315-
if (dir === opaqueDir || dir.startsWith(opaqueDir + path.sep)) {
316-
return true;
317-
}
318-
}
319-
return false;
313+
return Array.from(opaqueWhiteoutDirs).some((opaqueDir) =>
314+
isFileInFolder(filename, opaqueDir),
315+
);
320316
}
321317

322318
/**

0 commit comments

Comments
 (0)