Merge branch 'main' into ssh-mirror-migrations

This commit is contained in:
pomidorry authored and GitHub committed 2026-05-18 14:48:04 +03:00
commit 1fed086975
325 files changed
+1354 -1319

No files matched your search

+10
View File
@@ -173,6 +173,16 @@ func PrepareCommitFormOptions(ctx *Context, doer *user_model.User, targetRepo *r
protectedBranch.Repo = targetRepo
canPushWithProtection = protectedBranch.CanUserPush(ctx, doer)
protectionRequireSigned = protectedBranch.RequireSignedCommits
// If branch-wide push is restricted, allow direct commit when the
// URL-derived tree path matches an unprotected file pattern. The
// pre-receive hook re-checks every path the commit actually touches
// (e.g. rename source and destination).
if !canPushWithProtection && ctx.Repo.TreePath != "" && protectedBranch.UnprotectedFilePatterns != "" {
globs := protectedBranch.GetUnprotectedFilePatterns()
if protectedBranch.IsUnprotectedFile(globs, ctx.Repo.TreePath) {
canPushWithProtection = true
}
}
}
targetGitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, targetRepo)
+1 -1
View File
@@ -7,7 +7,7 @@ package migrations
import (
"errors"
"github.com/google/go-github/v85/github"
"github.com/google/go-github/v86/github"
)
// ErrRepoNotCreated returns the error that repository not created
+1 -1
View File
@@ -20,7 +20,7 @@ import (
"code.gitea.io/gitea/modules/proxy"
"code.gitea.io/gitea/modules/structs"
"github.com/google/go-github/v85/github"
"github.com/google/go-github/v86/github"
"golang.org/x/oauth2"
)
+2 -3
View File
@@ -6,13 +6,12 @@ package versioned_migration
import (
"context"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/migrations"
"code.gitea.io/gitea/modules/globallock"
"xorm.io/xorm"
)
func Migrate(ctx context.Context, x *xorm.Engine) error {
func Migrate(ctx context.Context, x db.EngineMigration) error {
// only one instance can do the migration at the same time if there are multiple instances
release, err := globallock.Lock(ctx, "gitea_versioned_migration")
if err != nil {