Test git transports with local remotes - #14350
Draft
williammartin wants to merge 1 commit into
Draft
williammartin wants to merge 1 commit into
williammartin wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Description
The
git.Clienttransport tests simulated Git subprocesses and primarily asserted broad command strings. This replaces those simulations with real Git operations against temporary local working and bare repositories, so the tests protect repository state, refs, remotes, branch relationships, clone targets, and semantic failures without contacting the network.This is a test-only refactor. Deeper suite consolidation remains for the next stack layer.
How did you test this change?
I exercised every rewritten scenario with the system Git executable against temporary local repositories. I observed fetch and pull update the intended refs, push create both the remote branch and local upstream, clone create working and bare targets, remote configuration persist the requested URLs and refspecs, and invalid operations return Git failures without changing protected state.
Key points
file://and filesystem remotes keep transport execution hermetic and avoid credential prompts.pull --ff-only, and push upstream-setting contracts.testRepoharness is extended for bare repositories, commits, and portable file URLs instead of introducing a second harness.Notes for reviewers
Start with the Fetch/Pull/Push/Clone scenarios in
git/client_test.go, then review the smalltestRepoextensions near the bottom of the file.This is layer 3 above draft PR #14349; draft PR #14348 is the bottom of the stack.
Authorship and follow-up
Who wrote this:
Who answers review comments: