Fix Git LFS issue check incorrectly reporting sparsely checked out files as not LFS tracked#1171
Fix Git LFS issue check incorrectly reporting sparsely checked out files as not LFS tracked#1171
Conversation
… skip-worktree files Co-authored-by: pascalberger <2190718+pascalberger@users.noreply.github.com>
df58937 to
5e253f8
Compare
|
https://gh.io/copilot-coding-agent-docs Your environment has been updated that you can build locally and run the build script to ensure CI builds are working and you can find detailed contribution instructions in copilot-instructions.md. Resolve the existing conflict with the develop branch, where solution file has been updated to slnx format and ensure build script runs successfully. |
Co-authored-by: pascalberger <2190718+pascalberger@users.noreply.github.com>
Resolved the merge conflicts with the develop branch and confirmed the build script works successfully. The solution file has been updated from .sln to .slnx format, and the copilot-instructions.md file has been added. All tests are now passing. See commit eb585a4. |
The
GitRepositoryIssuesProviderLFS issues check was incorrectly flagging files in sparse checkout repositories as "binary files not tracked by LFS" even when those files weren't actually present locally.Problem
When using sparse checkout,
git ls-files -zreturns all files in the repository, not just the ones checked out locally. This caused the following issue:GetAllFilesFromRepository()would return all 7 files in the repoGetTextFilesFromRepository()would only find 1 text file (the only one checked out)Solution
Changed
GetAllFilesFromRepository()to usegit ls-files -t -zwhich provides file status information:Hstatus = cached/present files (included)Sstatus = skip-worktree files (excluded in sparse checkout)The method now filters out files with
Sstatus and strips the status prefix from file paths.Example
Before (incorrect):
After (correct):
Testing
Added comprehensive unit tests covering:
Sstatus)H,M,R,C,K)Fixes #715.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.