Skip to content

Commit edbc955

Browse files
authored
Merge branch 'main' into branch-by-id
2 parents 993257e + ebaf4c4 commit edbc955

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

.revive.toml

+1
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ warningCode = 1
2323
[rule.unexported-return]
2424
[rule.indent-error-flow]
2525
[rule.errorf]
26+
[rule.duplicated-imports]

models/issue.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"code.gitea.io/gitea/modules/base"
1919
"code.gitea.io/gitea/modules/log"
2020
"code.gitea.io/gitea/modules/references"
21-
"code.gitea.io/gitea/modules/structs"
2221
api "code.gitea.io/gitea/modules/structs"
2322
"code.gitea.io/gitea/modules/timeutil"
2423
"code.gitea.io/gitea/modules/util"
@@ -2116,7 +2115,7 @@ func (issue *Issue) ResolveMentionsByVisibility(ctx context.Context, doer *User,
21162115
}
21172116

21182117
// UpdateIssuesMigrationsByType updates all migrated repositories' issues from gitServiceType to replace originalAuthorID to posterID
2119-
func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, posterID int64) error {
2118+
func UpdateIssuesMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, posterID int64) error {
21202119
_, err := db.GetEngine(db.DefaultContext).Table("issue").
21212120
Where("repo_id IN (SELECT id FROM repository WHERE original_service_type = ?)", gitServiceType).
21222121
And("original_author_id = ?", originalAuthorID).
@@ -2129,7 +2128,7 @@ func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, origina
21292128
}
21302129

21312130
// UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID
2132-
func UpdateReactionsMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, userID int64) error {
2131+
func UpdateReactionsMigrationsByType(gitServiceType api.GitServiceType, originalAuthorID string, userID int64) error {
21332132
_, err := db.GetEngine(db.DefaultContext).Table("reaction").
21342133
Where("original_author_id = ?", originalAuthorID).
21352134
And(migratedIssueCond(gitServiceType)).

modules/convert/convert.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"code.gitea.io/gitea/models/login"
1616
"code.gitea.io/gitea/modules/git"
1717
"code.gitea.io/gitea/modules/log"
18-
"code.gitea.io/gitea/modules/structs"
1918
api "code.gitea.io/gitea/modules/structs"
2019
"code.gitea.io/gitea/modules/util"
2120
"code.gitea.io/gitea/services/webhook"
@@ -158,7 +157,7 @@ func ToVerification(c *git.Commit) *api.PayloadCommitVerification {
158157
commitVerification.Payload = c.Signature.Payload
159158
}
160159
if verif.SigningUser != nil {
161-
commitVerification.Signer = &structs.PayloadUser{
160+
commitVerification.Signer = &api.PayloadUser{
162161
Name: verif.SigningUser.Name,
163162
Email: verif.SigningUser.Email,
164163
}

modules/migrations/gitea_uploader.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"code.gitea.io/gitea/modules/git"
2121
"code.gitea.io/gitea/modules/log"
2222
"code.gitea.io/gitea/modules/migrations/base"
23-
"code.gitea.io/gitea/modules/repository"
2423
repo_module "code.gitea.io/gitea/modules/repository"
2524
"code.gitea.io/gitea/modules/setting"
2625
"code.gitea.io/gitea/modules/storage"
@@ -111,7 +110,7 @@ func (g *GiteaLocalUploader) CreateRepo(repo *base.Repository, opts base.Migrate
111110
}
112111
r.DefaultBranch = repo.DefaultBranch
113112

114-
r, err = repository.MigrateRepositoryGitData(g.ctx, owner, r, base.MigrateOptions{
113+
r, err = repo_module.MigrateRepositoryGitData(g.ctx, owner, r, base.MigrateOptions{
115114
RepoName: g.repoName,
116115
Description: repo.Description,
117116
OriginalURL: repo.OriginalURL,
@@ -341,7 +340,7 @@ func (g *GiteaLocalUploader) CreateReleases(releases ...*base.Release) error {
341340

342341
// SyncTags syncs releases with tags in the database
343342
func (g *GiteaLocalUploader) SyncTags() error {
344-
return repository.SyncReleasesWithTags(g.repo, g.gitRepo)
343+
return repo_module.SyncReleasesWithTags(g.repo, g.gitRepo)
345344
}
346345

347346
// CreateIssues creates issues

routers/api/v1/repo/transfer.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"code.gitea.io/gitea/modules/context"
1313
"code.gitea.io/gitea/modules/convert"
1414
"code.gitea.io/gitea/modules/log"
15-
"code.gitea.io/gitea/modules/structs"
1615
api "code.gitea.io/gitea/modules/structs"
1716
"code.gitea.io/gitea/modules/web"
1817
repo_service "code.gitea.io/gitea/services/repository"
@@ -65,7 +64,7 @@ func Transfer(ctx *context.APIContext) {
6564
}
6665

6766
if newOwner.Type == models.UserTypeOrganization {
68-
if !ctx.User.IsAdmin && newOwner.Visibility == structs.VisibleTypePrivate && !newOwner.HasMemberWithUserID(ctx.User.ID) {
67+
if !ctx.User.IsAdmin && newOwner.Visibility == api.VisibleTypePrivate && !newOwner.HasMemberWithUserID(ctx.User.ID) {
6968
// The user shouldn't know about this organization
7069
ctx.Error(http.StatusNotFound, "", "The new owner does not exist or cannot be found")
7170
return

0 commit comments

Comments
 (0)