diff options
Diffstat (limited to 'modules/repofiles/action_test.go')
-rw-r--r-- | modules/repofiles/action_test.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/modules/repofiles/action_test.go b/modules/repofiles/action_test.go index 97ac1c45e9..85bf39c835 100644 --- a/modules/repofiles/action_test.go +++ b/modules/repofiles/action_test.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/git" + "code.gitea.io/gitea/modules/repository" "github.com/stretchr/testify/assert" ) @@ -34,8 +35,8 @@ func TestCommitRepoAction(t *testing.T) { RefFullName: "refName", OldCommitID: "oldCommitID", NewCommitID: "newCommitID", - Commits: &models.PushCommits{ - Commits: []*models.PushCommit{ + Commits: &repository.PushCommits{ + Commits: []*repository.PushCommit{ { Sha1: "69554a6", CommitterEmail: "user2@example.com", @@ -68,7 +69,7 @@ func TestCommitRepoAction(t *testing.T) { RefFullName: git.TagPrefix + "v1.1", OldCommitID: git.EmptySHA, NewCommitID: "newCommitID", - Commits: &models.PushCommits{}, + Commits: &repository.PushCommits{}, }, action: models.Action{ OpType: models.ActionPushTag, @@ -82,7 +83,7 @@ func TestCommitRepoAction(t *testing.T) { RefFullName: git.TagPrefix + "v1.1", OldCommitID: "oldCommitID", NewCommitID: git.EmptySHA, - Commits: &models.PushCommits{}, + Commits: &repository.PushCommits{}, }, action: models.Action{ OpType: models.ActionDeleteTag, @@ -96,7 +97,7 @@ func TestCommitRepoAction(t *testing.T) { RefFullName: git.BranchPrefix + "feature/1", OldCommitID: "oldCommitID", NewCommitID: git.EmptySHA, - Commits: &models.PushCommits{}, + Commits: &repository.PushCommits{}, }, action: models.Action{ OpType: models.ActionDeleteBranch, @@ -127,7 +128,7 @@ func TestCommitRepoAction(t *testing.T) { func TestUpdateIssuesCommit(t *testing.T) { assert.NoError(t, models.PrepareTestDatabase()) - pushCommits := []*models.PushCommit{ + pushCommits := []*repository.PushCommit{ { Sha1: "abcdef1", CommitterEmail: "user2@example.com", @@ -174,7 +175,7 @@ func TestUpdateIssuesCommit(t *testing.T) { models.CheckConsistencyFor(t, &models.Action{}) // Test that push to a non-default branch closes no issue. - pushCommits = []*models.PushCommit{ + pushCommits = []*repository.PushCommit{ { Sha1: "abcdef1", CommitterEmail: "user2@example.com", @@ -203,7 +204,7 @@ func TestUpdateIssuesCommit(t *testing.T) { func TestUpdateIssuesCommit_Colon(t *testing.T) { assert.NoError(t, models.PrepareTestDatabase()) - pushCommits := []*models.PushCommit{ + pushCommits := []*repository.PushCommit{ { Sha1: "abcdef2", CommitterEmail: "user2@example.com", @@ -231,7 +232,7 @@ func TestUpdateIssuesCommit_Issue5957(t *testing.T) { user := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User) // Test that push to a non-default branch closes an issue. - pushCommits := []*models.PushCommit{ + pushCommits := []*repository.PushCommit{ { Sha1: "abcdef1", CommitterEmail: "user2@example.com", @@ -266,7 +267,7 @@ func TestUpdateIssuesCommit_AnotherRepo(t *testing.T) { // Test that a push to default branch closes issue in another repo // If the user also has push permissions to that repo - pushCommits := []*models.PushCommit{ + pushCommits := []*repository.PushCommit{ { Sha1: "abcdef1", CommitterEmail: "user2@example.com", @@ -301,7 +302,7 @@ func TestUpdateIssuesCommit_AnotherRepoNoPermission(t *testing.T) { // Test that a push with close reference *can not* close issue // If the commiter doesn't have push rights in that repo - pushCommits := []*models.PushCommit{ + pushCommits := []*repository.PushCommit{ { Sha1: "abcdef3", CommitterEmail: "user10@example.com", |