cake-contrib / cake-contrib/Cake.Issues
Git LFS Issue check incorrectly reports sparsely checked out files as not LFS tracked
- Dominant language
- C#
- Stars
- 7
- Forks
- 11
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
Running the `GitRepositoryIssuesProvider` LFS issues check against a sparse-checkout Git repo yields files that aren't checked out as erroneously binary non-LFS files.
_Steps to reproduce:_
- Clone a repository with sparse checkout such that only a single sub-directory in the repo is present on disk
- Run the Git commands `GitRepositoryIssuesProvider` would run
- `git lfs ls-files -n` yields the binary untracked files correctly
- `git grep -Ul .` and `git grep -UL .` yield the working files
- `git ls-files -z` reports the **_entire_** working tree
_Expected result:_
LFS files are only reported as not tracked if they are actually not tracked
_Actual result:_
All files not in the current sparse checkout are reported as LFS untracked
_Workaround:_
None
_Possible fix:_
Use `git ls-files -t -z` and parse the output such that `S` code files are not included in the `allFiles` variable.
Hope that helps!
Contributor guide
Assessment
This issue has not been assessed yet.