Skip to content

Commit f3440e4

Browse files
claudebranchseer
authored andcommitted
Keep original fspy path for fingerprinting, only clean for glob matching
The cleaned path (with `..` normalized) is used solely for matching against negative globs. The original stripped path is returned and stored in the fingerprint, keeping create/validate consistent. Restore fingerprint.rs to use the path as-is since it already contains the original fspy-reported relative path. https://claude.ai/code/session_01PR9yhnScRoVoHUcviV47u5
1 parent 078f722 commit f3440e4

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

crates/vite_task/src/session/execute/spawn.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,23 @@ pub async fn spawn_with_tracking(
199199
// On Windows, paths are possible to be still absolute after stripping the workspace root.
200200
// For example: c:\workspace\subdir\c:\workspace\subdir
201201
// Just ignore those accesses.
202-
let cleaned = path_clean::PathClean::clean(stripped_path);
203-
let relative = RelativePathBuf::new(cleaned).ok()?;
202+
let relative = RelativePathBuf::new(stripped_path).ok()?;
204203

205204
// Skip .git directory accesses (workaround for tools like oxlint)
206205
if relative.as_path().strip_prefix(".git").is_ok() {
207206
return None;
208207
}
209208

210-
// Filter against resolved negative globs (both are workspace-root-relative)
211-
if resolved_negatives.iter().any(|neg| neg.is_match(relative.as_str())) {
212-
return None;
209+
// Clean `..` components only for glob matching — fspy may report paths
210+
// like `packages/sub-pkg/../shared/dist/output.js` that won't match
211+
// workspace-root-relative negative globs without normalization.
212+
if !resolved_negatives.is_empty() {
213+
let cleaned = path_clean::PathClean::clean(relative.as_path());
214+
if let Some(cleaned_str) = cleaned.to_str()
215+
&& resolved_negatives.iter().any(|neg| neg.is_match(cleaned_str))
216+
{
217+
return None;
218+
}
213219
}
214220

215221
Some(relative)

crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-negative-glob-subpackage/snapshots/dotdot auto negative - miss on non-excluded sibling inferred file.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ export const shared = 'initial';
99
> replace-file-content packages/shared/src/utils.ts initial modified
1010

1111
> vp run sub-pkg#dotdot-auto-negative
12-
~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.jscache miss: content of input 'packages/shared/src/utils.ts' changed, executing
12+
~/packages/sub-pkg$ print-file ../shared/src/utils.ts ../shared/dist/output.jscache miss: content of input 'packages/sub-pkg/../shared/src/utils.ts' changed, executing
1313
export const shared = 'modified';
1414
// initial output

0 commit comments

Comments
 (0)