@@ -13,6 +13,7 @@ import (
1313 "code.gitea.io/gitea/models"
1414 "code.gitea.io/gitea/models/unittest"
1515 user_model "code.gitea.io/gitea/models/user"
16+ "code.gitea.io/gitea/modules/git"
1617 pull_service "code.gitea.io/gitea/services/pull"
1718 repo_service "code.gitea.io/gitea/services/repository"
1819 files_service "code.gitea.io/gitea/services/repository/files"
@@ -28,7 +29,7 @@ func TestAPIPullUpdate(t *testing.T) {
2829 pr := createOutdatedPR (t , user , org26 )
2930
3031 //Test GetDiverging
31- diffCount , err := pull_service .GetDiverging (pr )
32+ diffCount , err := pull_service .GetDiverging (git . DefaultContext , pr )
3233 assert .NoError (t , err )
3334 assert .EqualValues (t , 1 , diffCount .Behind )
3435 assert .EqualValues (t , 1 , diffCount .Ahead )
@@ -41,7 +42,7 @@ func TestAPIPullUpdate(t *testing.T) {
4142 session .MakeRequest (t , req , http .StatusOK )
4243
4344 //Test GetDiverging after update
44- diffCount , err = pull_service .GetDiverging (pr )
45+ diffCount , err = pull_service .GetDiverging (git . DefaultContext , pr )
4546 assert .NoError (t , err )
4647 assert .EqualValues (t , 0 , diffCount .Behind )
4748 assert .EqualValues (t , 2 , diffCount .Ahead )
@@ -56,7 +57,7 @@ func TestAPIPullUpdateByRebase(t *testing.T) {
5657 pr := createOutdatedPR (t , user , org26 )
5758
5859 //Test GetDiverging
59- diffCount , err := pull_service .GetDiverging (pr )
60+ diffCount , err := pull_service .GetDiverging (git . DefaultContext , pr )
6061 assert .NoError (t , err )
6162 assert .EqualValues (t , 1 , diffCount .Behind )
6263 assert .EqualValues (t , 1 , diffCount .Ahead )
@@ -69,7 +70,7 @@ func TestAPIPullUpdateByRebase(t *testing.T) {
6970 session .MakeRequest (t , req , http .StatusOK )
7071
7172 //Test GetDiverging after update
72- diffCount , err = pull_service .GetDiverging (pr )
73+ diffCount , err = pull_service .GetDiverging (git . DefaultContext , pr )
7374 assert .NoError (t , err )
7475 assert .EqualValues (t , 0 , diffCount .Behind )
7576 assert .EqualValues (t , 1 , diffCount .Ahead )
@@ -98,7 +99,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
9899 assert .NotEmpty (t , headRepo )
99100
100101 //create a commit on base Repo
101- _ , err = files_service .CreateOrUpdateRepoFile (baseRepo , actor , & files_service.UpdateRepoFileOptions {
102+ _ , err = files_service .CreateOrUpdateRepoFile (git . DefaultContext , baseRepo , actor , & files_service.UpdateRepoFileOptions {
102103 TreePath : "File_A" ,
103104 Message : "Add File A" ,
104105 Content : "File A" ,
@@ -121,7 +122,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
121122 assert .NoError (t , err )
122123
123124 //create a commit on head Repo
124- _ , err = files_service .CreateOrUpdateRepoFile (headRepo , actor , & files_service.UpdateRepoFileOptions {
125+ _ , err = files_service .CreateOrUpdateRepoFile (git . DefaultContext , headRepo , actor , & files_service.UpdateRepoFileOptions {
125126 TreePath : "File_B" ,
126127 Message : "Add File on PR branch" ,
127128 Content : "File B" ,
@@ -160,7 +161,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *models.Pul
160161 BaseRepo : baseRepo ,
161162 Type : models .PullRequestGitea ,
162163 }
163- err = pull_service .NewPullRequest (baseRepo , pullIssue , nil , nil , pullRequest , nil )
164+ err = pull_service .NewPullRequest (git . DefaultContext , baseRepo , pullIssue , nil , nil , pullRequest , nil )
164165 assert .NoError (t , err )
165166
166167 issue := unittest .AssertExistsAndLoadBean (t , & models.Issue {Title : "Test Pull -to-update-" }).(* models.Issue )
0 commit comments