cake-contrib / cake-contrib/Cake.Issues

Git LFS Issue check incorrectly reports sparsely checked out files as not LFS tracked

Open
#715 2 comments 1 reaction 1 assignee Assigned to @Copilot View on GitHub
Area:IssueProvider:GitRepository Bug Hacktoberfest help wanted up-for-grabs
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.