{{ message }}
Repository navigation
Test git client with real repositories - #14348
Draft
williammartin wants to merge 2 commits into
Draft
williammartin wants to merge 2 commits into
williammartin wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The push-revision test compares the actual Git error against itself instead of the expected fixture.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
What changed in this PR
Refactors Git client tests to exercise real temporary repositories while retaining targeted command fakes.
Changes:
- Adds an isolated temporary-repository test harness.
- Converts branch, config, remote, ignore, and working-tree tests.
- Preserves coverage environment variables in helper subprocesses.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2 of 6 tasks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6b88dd22-b2ac-412c-b339-c5c0bd03e5dc
2 of 6 tasks
This branch has not been deployed
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.


N/A
Description
Several
git.Clienttests emulate Git by re-executing the test binary with hand-authored output. This makes the tests describe the mock protocol rather than repository behavior, slows race runs, and breaks coverage instrumentation when helper subprocesses discard Go's coverage environment.This adds a small hermetic temporary-repository harness and converts a pilot cluster covering current branches, config, working-tree changes, remote URLs, ignore rules, and remote resolution. Narrow fakes remain for non-portable failures and exact
--argument-safety contracts. Helper subprocesses now inherit the parent environment so package coverage works.How did you test this change?
Not tested manually because this refactors test implementation only and does not change production behavior.
Key points
The temporary repositories are sequential because Git configuration isolation currently uses
t.Setenv. Synthetic tests remain only where real Git cannot portably produce a precise error or where exact command construction is the safety contract.Notes for reviewers
Start with
newTestRepoand itsrunhelper, then review the converted scenarios. This is stack layer 1; stack metadata will be registered separately after the remaining layers exist.Authorship and follow-up
Who wrote this:
Who answers review comments: