@@ -144,16 +144,19 @@ func TestPatchStatus(t *testing.T) {
144144 require .NoError (t , git .NewCommand (t .Context (), "push" , "origin" , "HEAD:main" ).Run (& git.RunOpts {Dir : dstPath }))
145145 require .NoError (t , git .NewCommand (t .Context (), "switch" , "normal" ).Run (& git.RunOpts {Dir : dstPath }))
146146
147- assertConflictAndLoadBean := func (t * testing.T , pr * issues_model.PullRequest , flow string ) * issues_model.PullRequest {
147+ assertConflictAndLoadBean := func (t * testing.T , pr issues_model.PullRequest , flow string ) * issues_model.PullRequest {
148148 t .Helper ()
149+ var found * issues_model.PullRequest
149150 assert .Eventually (t , func () bool {
150- return unittest .AssertExistsAndLoadBean (t , pr , flow ).Status == issues_model .PullRequestStatusConflict
151+ examplar := pr
152+ found = unittest .AssertExistsAndLoadBean (t , & examplar , flow )
153+ return found .Status == issues_model .PullRequestStatusConflict
151154 }, time .Second * 30 , time .Millisecond * 200 )
152- return pr
155+ return found
153156 }
154157 // Wait until status check queue is done, we cannot access the queue's
155158 // internal information so we rely on the status of the patch being changed.
156- _ = assertConflictAndLoadBean (t , & issues_model.PullRequest {ID : normalAGitPR .ID }, "flow = 1" )
159+ _ = assertConflictAndLoadBean (t , issues_model.PullRequest {ID : normalAGitPR .ID }, "flow = 1" )
157160
158161 test := func (t * testing.T , pr * issues_model.PullRequest ) {
159162 t .Helper ()
@@ -170,7 +173,7 @@ func TestPatchStatus(t *testing.T) {
170173 t .Run ("Existing" , func (t * testing.T ) {
171174 defer tests .PrintCurrentTest (t )()
172175
173- pr := assertConflictAndLoadBean (t , & issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "normal" }, "flow = 0" )
176+ pr := assertConflictAndLoadBean (t , issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "normal" }, "flow = 0" )
174177 test (t , pr )
175178 testAutomergeQueued (t , pr , issues_model .PullRequestStatusConflict )
176179 })
@@ -181,7 +184,7 @@ func TestPatchStatus(t *testing.T) {
181184 require .NoError (t , git .NewCommand (t .Context (), "push" , "fork" , "HEAD:conflict" ).Run (& git.RunOpts {Dir : dstPath }))
182185 testPullCreateDirectly (t , session , repo .OwnerName , repo .Name , repo .DefaultBranch , forkRepo .OwnerName , forkRepo .Name , "conflict" , "across repo conflict" )
183186
184- test (t , assertConflictAndLoadBean (t , & issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "conflict" }, "flow = 0" ))
187+ test (t , assertConflictAndLoadBean (t , issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "conflict" }, "flow = 0" ))
185188 })
186189 })
187190
0 commit comments