Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hotchkj opened this issue Aug 14, 2024 · 2 comments

Comments

@hotchkj
Copy link

hotchkj commented Aug 14, 2024

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!

@pascalberger
Copy link
Member

@hotchkj Thanks for reporting the issue 👍 Your suggested fix seems reasonable. Are you in a position to provide a pull request for fixing this?

@hotchkj
Copy link
Author

hotchkj commented Aug 19, 2024

Apologies for the delay in reply - I will not immediately be in a position to provide a PR for this, though I will raise this as a ticket internally at my company in the event that we can get signoff to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants