File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,9 +264,23 @@ struct ActionHolder {
264264 size_t [] pendingTargets;
265265 switch (type) {
266266 case ActionType.changed:
267- if (src in srcMap && actions[srcMap[src]].type == ActionType.changed) {
268- // skip duplicate operations
269- return ;
267+ if (src in srcMap) {
268+ size_t pendingTarget = srcMap[src];
269+ switch (actions[pendingTarget].type) {
270+ case ActionType.changed:
271+ // Skip duplicate change operations for the same path.
272+ return ;
273+ case ActionType.deleted:
274+ // A delete followed by a change for the same path means the path is
275+ // present again before this event batch is processed. Suppress the
276+ // stale delete and process the final local state as a change.
277+ if (debugLogging) {addLogEntry(" Coalescing same-path delete followed by change; suppressing stale delete: " ~ src, [" debug" ]);}
278+ actions[pendingTarget].skipped = true ;
279+ srcMap.remove(src);
280+ break ;
281+ default :
282+ break ;
283+ }
270284 }
271285 break ;
272286 case ActionType.createDir:
You can’t perform that action at this time.
0 commit comments