Repository navigation
fix: report a directory listed twice instead of panicking (#260) - #21
Merged
Merged
Conversation
assemble_tree unwrapped the branch entry for every directory. An entry can only be missing if the walker reported the same directory twice, which panicked the assembler thread (upstream solidiquis#260). Return Error::DuplicateDirectory naming the path so the cause is diagnosable.
jeiang
enabled auto-merge
October 14, 2026 16:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upstream solidiquis#260's video shows
called Option::unwrap() on a None valueatbranches.remove(current_node.path()).unwrap()inassemble_tree(src/tree/mod.rs:203 in v3.1.2 and before this PR). Every directory gets exactly one branch entry when it arrives, so a missing entry means the walker reported that directory twice.Not reproduced: macOS
/(6M entries), GitHub Ubuntu kernel 6.17 withsudoon/,/sys,/proc(master and v3.1.2), and a NixOS host on kernel 7.2.4 withsudoon every top-level directory except/mnt(master and v3.1.2) plus 3 pty runs of/with the progress indicator (3.66M lines each). The reporter used Arch on kernel 6.13.1.This PR does not guess at deduplication (skipping the duplicate would still double-count its children); it turns the panic into
erd: The filesystem reported directory '<path>' more than once; please report this at …, exit 1, so the next report contains the offending path.Unit test
tree::test::duplicate_directory_is_an_errorfeeds the same directory twice intoassemble_treeand asserts the error names it (the old signature returned()and panicked here). Local: fmt, clippy (host + Windows cross), fullcargo test --locked.