Repository navigation
status: use DiffIndexScanner to populate results - #2042
Conversation
| Print("") | ||
| } | ||
|
|
||
| func scanIndex(ref string) (<-chan *lfs.DiffIndexEntry, <-chan error, error) { |
There was a problem hiding this comment.
Does this really need to return 2 channels? It means every caller has to setup a complex select with a goto to use it. What do you think about returning two slices of diff entries instead? The non-porcelain status calls are collecting them into two slices anyway. Also, scanIndex() would be a convenient spot to do any post-scan operations, such as sorting, or bulk cat-file calls if needed.
There was a problem hiding this comment.
@technoweenie good call. My original intent was that this could be consumed asynchronously in case the number of diff-index entries was large, but since they get collected into a slice anyway, I don't think it matters.
I went ahead and made this change in 0fb059d, and I think that this PR is now ready to merge. 👍
technoweenie
left a comment
There was a problem hiding this comment.
Thanks for making the change 🤘
This pull-request brings us another step closer to adding additional information to the output of the
statuscommand by using the new*lfs.DiffIndexScannerinstead of thegitscanner.By doing so, we give the status command direct access to the
*lfs.DiffIndexScannerinstance, which will eventually receive methods that can answer and provide additional information about why certain files are modified./cc @git-lfs/core