Skip to content

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

@hotchkj

Description

@hotchkj

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!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions