Tier 1 — Replace. src/Fallout.Build/VCS/GitRepository.cs (~268 LOC) hand-parses git internals — .git/config, .git/HEAD, packed-refs — and uses a regex to crack remote URLs (HTTPS/SSH). This is the single most fragile spot found in the audit: it breaks if git changes its on-disk format.
Replace with
LibGit2Sharp — the standard .NET libgit2 binding. Eliminates manual packed-refs/config parsing and the URL regex (use Uri).
Scope
src/Fallout.Build/VCS/GitRepository.cs — FromLocalDirectory(), GetRemoteConnectionFromUrl(), GetRemoteConnectionFromConfig()
- Keep
GitRepositoryExtensions.cs (simple branch-name comparisons) as-is.
Non-breaking
Wrap LibGit2Sharp behind the existing GitRepository public surface — additive, no consumer signature changes. Target the 2026 line directly.
Acceptance
From dependency-consolidation audit, 2026-06-02.
Tier 1 — Replace.
src/Fallout.Build/VCS/GitRepository.cs(~268 LOC) hand-parses git internals —.git/config,.git/HEAD,packed-refs— and uses a regex to crack remote URLs (HTTPS/SSH). This is the single most fragile spot found in the audit: it breaks if git changes its on-disk format.Replace with
LibGit2Sharp — the standard .NET libgit2 binding. Eliminates manual
packed-refs/config parsing and the URL regex (useUri).Scope
src/Fallout.Build/VCS/GitRepository.cs—FromLocalDirectory(),GetRemoteConnectionFromUrl(),GetRemoteConnectionFromConfig()GitRepositoryExtensions.cs(simple branch-name comparisons) as-is.Non-breaking
Wrap LibGit2Sharp behind the existing
GitRepositorypublic surface — additive, no consumer signature changes. Target the 2026 line directly.Acceptance
.gitfile/regex parsing removed; introspection backed by LibGit2SharpGitRepositoryAPI unchanged (verified against call sites)From dependency-consolidation audit, 2026-06-02.