Chore/sdk 2.21.1 lf migration - #377
Open
matt-edmondson wants to merge 3 commits into
Open
Conversation
Adopt the SDK's synced style configuration and the metadata it derives from it. The .gitattributes rewrite normalizes the repository to LF and routes *.png through the Git LFS clean filter, so icon.png is now stored as a pointer rather than 16 KB of raw bytes. Add the direct package references the KTSU0006 transitive-package analyzer requires for types already in use.
libgit2 implements neither the clean and smudge filters nor the hooks, and Git LFS is built entirely out of those. For this application the half that bites is the smudge filter: cloning through LibGit2Sharp writes each LFS pointer to disk as its literal text, so a repository that tracks binaries comes down looking like a set of three-line files rather than its content. All git work now goes through GitCli, which starts the git command through ktsu.RunCommand. Arguments are passed as a list rather than as one command string, so paths containing spaces need no quoting, and RunIn uses git -C so the process working directory is never mutated -- which is what keeps the background fetches safe to run concurrently. Notable call site changes: - Clone, fetch and status move across directly. Pull becomes --ff-only. The old code performed a real merge, committed it unattended, and swallowed CheckoutConflictException, which left the working tree mid-conflict with nothing said about it. - Repository discovery takes the parent of each .git directory rather than asking libgit2 for the working directory, and reads the remote with git remote get-url. - The index enumeration behind the repository diff becomes git ls-files -z. NUL separation turns off the quoting git otherwise applies to unusual paths, so names arrive exactly as recorded. - RepositoryNotFoundException was driving control flow in four places. Those become an explicit GitCli.IsRepository check. - The log panel carried libgit2's debug trace. It now carries what git reported for each clone, fetch and pull, which is what someone watching that panel actually wants to see. There are no credentials in this code any more: git uses the platform credential helper, which also makes SSH remotes work. Add ProjectDirector.Test, the repository's first test project. GitCliTests pins both halves of the LFS guarantee -- a tracked binary is committed as a pointer and comes back out of a clone as its content -- plus the repository detection, tracked-file listing and remote lookup that replaced the exception handling. Also correct the solution configuration, which mapped Release to Debug, so building Release produced a Debug binary.
Resolves the two files both sides touched: - global.json keeps ktsu.Sdk 2.21.1. The incoming dependabot commit moved it 2.18.0 -> 2.19.0, which this branch is already past. - Directory.Packages.props keeps the pruned list, so LibGit2Sharp stays removed and ktsu.RunCommand stays, while taking the incoming OpenAI bump to 2.13.0. Build and all 7 tests pass on the merged tree.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.