Commit 8bc316a
committed
fix(git_discovery): collect all nested modules subtrees, not just the last
Closes #211.
`find_git_module_info_dirs::walk` tracked the nested \`modules\` dir
in a single \`Option<PathBuf>\`, so a directory listing that yielded
more than one entry whose \`file_name()\` matched \`modules\` would
keep only the last one walked. The case is unusual on
case-sensitive filesystems but reachable on case-insensitive ones
(macOS / NTFS) where \`modules\` and \`Modules\` can collide as dir
entries from different writers, and a future relax of the equality
match (icase, alt names) would silently start dropping subtrees.
Replace the \`Option<PathBuf>\` with a \`Vec<PathBuf>\` and walk each
collected nested-modules dir in turn. The \`return\` on the inner
\`fs::read_dir\` error becomes a \`continue\` so a single unreadable
nested dir no longer aborts the walk for sibling subtrees in the
same parent.
`cargo test --lib policy::git_discovery` is green (3/3, including
\`test_find_git_module_info_dirs_finds_nested_submodules\`).1 parent 34228f9 commit 8bc316a
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| |||
35 | 43 | | |
36 | 44 | | |
37 | 45 | | |
38 | | - | |
| 46 | + | |
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
46 | | - | |
| 54 | + | |
47 | 55 | | |
48 | 56 | | |
49 | | - | |
| 57 | + | |
50 | 58 | | |
51 | 59 | | |
52 | 60 | | |
| |||
0 commit comments