mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Always set the merge base used to merge the commit (#15352)
The issue is that the TestPatch will reset the PR MergeBase - and it is possible for TestPatch to update the MergeBase whilst a merge is ongoing. The ensuing merge will then complete but it doesn't re-set the MergeBase it used to merge the PR. Fixes the intermittent error in git test. Signed-off-by: Andrew Thornton art27@cantab.net
This commit is contained in:
		| @@ -239,6 +239,26 @@ func doAPICreatePullRequest(ctx APITestContext, owner, repo, baseBranch, headBra | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func doAPIGetPullRequest(ctx APITestContext, owner, repo string, index int64) func(*testing.T) (api.PullRequest, error) { | ||||
| 	return func(t *testing.T) (api.PullRequest, error) { | ||||
| 		urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d?token=%s", | ||||
| 			owner, repo, index, ctx.Token) | ||||
| 		req := NewRequest(t, http.MethodGet, urlStr) | ||||
|  | ||||
| 		expected := 200 | ||||
| 		if ctx.ExpectedCode != 0 { | ||||
| 			expected = ctx.ExpectedCode | ||||
| 		} | ||||
| 		resp := ctx.Session.MakeRequest(t, req, expected) | ||||
|  | ||||
| 		json := jsoniter.ConfigCompatibleWithStandardLibrary | ||||
| 		decoder := json.NewDecoder(resp.Body) | ||||
| 		pr := api.PullRequest{} | ||||
| 		err := decoder.Decode(&pr) | ||||
| 		return pr, err | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64) func(*testing.T) { | ||||
| 	return func(t *testing.T) { | ||||
| 		urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/merge?token=%s", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user