@@ -140,16 +140,19 @@ func TestPatchStatus(t *testing.T) {
140140 require .NoError (t , git .NewCommand (t .Context (), "push" , "origin" , "HEAD:main" ).Run (& git.RunOpts {Dir : dstPath }))
141141 require .NoError (t , git .NewCommand (t .Context (), "switch" , "normal" ).Run (& git.RunOpts {Dir : dstPath }))
142142
143- assertConflictAndLoadBean := func (t * testing.T , pr * issues_model.PullRequest , flow string ) * issues_model.PullRequest {
143+ assertConflictAndLoadBean := func (t * testing.T , pr issues_model.PullRequest , flow string ) * issues_model.PullRequest {
144144 t .Helper ()
145+ var found * issues_model.PullRequest
145146 assert .Eventually (t , func () bool {
146- return unittest .AssertExistsAndLoadBean (t , pr , flow ).Status == issues_model .PullRequestStatusConflict
147+ examplar := pr
148+ found = unittest .AssertExistsAndLoadBean (t , & examplar , flow )
149+ return found .Status == issues_model .PullRequestStatusConflict
147150 }, time .Second * 30 , time .Millisecond * 200 )
148- return pr
151+ return found
149152 }
150153 // Wait until status check queue is done, we cannot access the queue's
151154 // internal information so we rely on the status of the patch being changed.
152- _ = assertConflictAndLoadBean (t , & issues_model.PullRequest {ID : normalAGitPR .ID }, "flow = 1" )
155+ _ = assertConflictAndLoadBean (t , issues_model.PullRequest {ID : normalAGitPR .ID }, "flow = 1" )
153156
154157 test := func (t * testing.T , pr * issues_model.PullRequest ) {
155158 t .Helper ()
@@ -166,7 +169,7 @@ func TestPatchStatus(t *testing.T) {
166169 t .Run ("Existing" , func (t * testing.T ) {
167170 defer tests .PrintCurrentTest (t )()
168171
169- pr := assertConflictAndLoadBean (t , & issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "normal" }, "flow = 0" )
172+ pr := assertConflictAndLoadBean (t , issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "normal" }, "flow = 0" )
170173 test (t , pr )
171174 testAutomergeQueued (t , pr , issues_model .PullRequestStatusConflict )
172175 })
@@ -177,7 +180,7 @@ func TestPatchStatus(t *testing.T) {
177180 require .NoError (t , git .NewCommand (t .Context (), "push" , "fork" , "HEAD:conflict" ).Run (& git.RunOpts {Dir : dstPath }))
178181 testPullCreateDirectly (t , session , repo .OwnerName , repo .Name , repo .DefaultBranch , forkRepo .OwnerName , forkRepo .Name , "conflict" , "across repo conflict" )
179182
180- test (t , assertConflictAndLoadBean (t , & issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "conflict" }, "flow = 0" ))
183+ test (t , assertConflictAndLoadBean (t , issues_model.PullRequest {BaseRepoID : repo .ID , HeadRepoID : forkRepo .ID , HeadBranch : "conflict" }, "flow = 0" ))
181184 })
182185 })
183186
0 commit comments