Skip to content

Commit

Permalink
fix: use relative path as key in "links" map
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed Jun 1, 2020
1 parent b821a19 commit 58384db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/jest-haste-map/src/crawlers/watchman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,10 @@ export = async function watchmanCrawl(
queryResponse.files.map(async (link: WatchmanFile) => {
const name = normalizePathSep(link.name);
const linkPath = path.join(watchRoot, name);
const relativePath = fastPath.relative(rootDir, linkPath);

if (!link.exists || ignore(linkPath)) {
data.links.delete(linkPath);
data.links.delete(relativePath);
return;
}

Expand All @@ -219,10 +220,10 @@ export = async function watchmanCrawl(
return; // Skip broken symlinks.
}

const metaData = data.links.get(linkPath);
const metaData = data.links.get(relativePath);
const mtime = testModified(metaData, link.mtime_ms);
dependencyLinks.set(
linkPath,
relativePath,
mtime !== 0 ? [target, mtime] : metaData!,
);

Expand Down

0 comments on commit 58384db

Please sign in to comment.