mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-11-04 14:23:43 -05:00
A sweep reads absence as deletion, which only holds when the walk would have seen the file had it been there. enumerates_whole_source is that test: volume indexing, recursive, no depth limit, no rules. Today one path passes it, archiving a removable drive, which is also the one case where the origin goes in a drawer and absence is all you will ever get. A browse dispatches IndexScope::Current on every directory listing, and a sweep after one of those would read the rest of the source as deleted. Rules are a per-walk parameter rather than a source property, so a walk that hides .git deletes what the walk before it recorded. discovery treats an unreadable directory as a non-critical error and finishes with that subtree missing, so finish_sweep takes the paths the walk failed to open and spares everything under them. Their bindings survive intact, and the next walk that can read them resolves them as unchanged rather than rediscovering them. Interrupt needed nothing: check_interrupt returns before the sweep closes. sweep_open carries the rest across serialization, and a walk resumed in a new process finds a ledger with no sweep and closes nothing.