mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 03:28:52 +02:00
Merge branch 'main' into ssh-mirror-migrations
This commit is contained in:
325 files changed
+1354
-1319
No files matched your search
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user