Add tests for Am configurations and threeWay override#464
Add tests for Am configurations and threeWay override#464michelle-clayton-work wants to merge 3 commits intomainfrom
Conversation
michelle-clayton-work
commented
Apr 7, 2026
- Address Add tests for Am configurations go#2215
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds regression tests to ensure patch application behavior is consistent regardless of user git am configuration, specifically am.threeWay, addressing the reported config-dependent behavior.
Changes:
- Add a new
MatchCheckRepo.CheckedApplyregression test that simulatesam.threeWay=truein the temp repo. - Add new
gitcmdpackage tests validatingAm(...)ignoresam.threeWaywhile still applying clean patches normally.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| patch/matching_test.go | Adds a parallel subtest suite verifying CheckedApply results are unchanged when am.threeWay=true is set in repo config. |
| gitcmd/gitcmd_test.go | Introduces integration-style tests for gitcmd.Am behavior with/without am.threeWay and clean vs. context-diverged patches. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| name := filepath.Base(testDir) | ||
| t.Run(name, func(t *testing.T) { | ||
| t.Parallel() | ||
| m := tempMoremathRepo(t, filepath.Join("testdata", name, "before")) |
There was a problem hiding this comment.
The inner part duplication here seems worth avoiding--a pretty flexible way to share the impl is to create a testMatchCheckRepo(t *testing.T) func and change TestMatchCheckRepo_Apply and TestMatchCheckRepo_ApplyWithThreeWayConfig to call it. Then, add testMatchCheckRepo params if necessary, like in this case a configureRepo func(r *MatchCheckRepo) that testMatchCheckRepo should call after creating the repo.
(Table-driven testing would work too. Maybe if there were a lot of configureRepo funcs to try out that would make sense.)