refactor(scan): move repository discovery out of the cli module - #58
Merged
Conversation
`find_repositories` is the filesystem-scanning engine: it walks the requested directory, decides which entries are repositories the user asked about, and collects their state in parallel. It lived in `cli`, whose job is parsing what the user typed, which left `Args` acting as both a data bag and the scanner. It moves to a `scan` module as free functions taking `&Args`, so the dependency runs one way: `scan` reads the arguments, `cli` knows nothing about walking the disk. `cli` drops from 175 to 84 lines and is now just the `Args` definition plus the output filter. Pure move - a binary built from the parent commit and this one produce byte-identical output across the flag matrix.
bircni
force-pushed
the
refactor/extract-scan-module
branch
from
August 23, 2026 20:56
1f83303 to
f2956dc
Compare
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.
Why
find_repositoriesis the filesystem-scanning engine — it walks the requesteddirectory, decides which entries are repositories the user asked about, and collects
their state in parallel. It lived in
cli, whose job is parsing what the user typed,which left
Argsacting as both a data bag and the scanner.What
It moves to a
scanmodule as free functions taking&Args, so the dependency runs oneway:
scanreads the arguments,cliknows nothing about walking the disk.cli.rsdrops from 175 to 84 lines — now just theArgsdefinition and the outputfilter.
scan.rsis 97 lines.Compatibility
Pure move, no behaviour change. A binary built from the parent commit and one built from
this branch produce byte-identical output across the flag matrix, on the same fixture
used in #56 (clean, dirty, detached, local-only, unpushed, stashed, worktree, nested,
unreadable and subdir repositories).
All 132 tests pass unchanged apart from the call-site rename.