File tree Expand file tree Collapse file tree
crates/vite_task/src/session/execute Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,18 +48,21 @@ fn collect_walk_entries(
4848 let path = entry. path ( ) ;
4949
5050 // Compute path relative to workspace_root for the result
51- let Some ( relative_to_workspace) = path
52- . strip_prefix ( workspace_root. as_path ( ) )
53- . ok ( )
54- . and_then ( |p| RelativePathBuf :: new ( p) . ok ( ) )
55- else {
51+ let Some ( stripped) = path. strip_prefix ( workspace_root. as_path ( ) ) . ok ( ) else {
5652 continue ; // Skip if path is outside workspace_root
5753 } ;
54+ let relative_to_workspace = RelativePathBuf :: new ( stripped) ?;
55+
56+ let std:: collections:: btree_map:: Entry :: Vacant ( vacant) =
57+ result. entry ( relative_to_workspace)
58+ else {
59+ continue ; // Already hashed by a previous glob pattern
60+ } ;
5861
5962 // Hash file content
6063 match hash_file_content ( path) {
6164 Ok ( hash) => {
62- result . insert ( relative_to_workspace , hash) ;
65+ vacant . insert ( hash) ;
6366 }
6467 Err ( err) if err. kind ( ) == io:: ErrorKind :: NotFound => {
6568 // File was deleted between walk and hash, skip it
You can’t perform that action at this time.
0 commit comments