mirror of
https://github.com/go-gitea/gitea
synced 2025-08-03 08:08:36 +00:00
Refactor: Move PushUpdateOptions (#13363)
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
This commit is contained in:
@@ -162,7 +162,7 @@ func DeleteBranch(ctx *context.APIContext) {
|
||||
|
||||
// Don't return error below this
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
&repo_module.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + ctx.Repo.BranchName,
|
||||
OldCommitID: c.ID.String(),
|
||||
NewCommitID: git.EmptySHA,
|
||||
|
@@ -18,6 +18,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/private"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
pull_service "code.gitea.io/gitea/services/pull"
|
||||
@@ -375,7 +376,7 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) {
|
||||
repoName := ctx.Params(":repo")
|
||||
|
||||
var repo *models.Repository
|
||||
updates := make([]*repo_service.PushUpdateOptions, 0, len(opts.OldCommitIDs))
|
||||
updates := make([]*repo_module.PushUpdateOptions, 0, len(opts.OldCommitIDs))
|
||||
wasEmpty := false
|
||||
|
||||
for i := range opts.OldCommitIDs {
|
||||
@@ -402,7 +403,7 @@ func HookPostReceive(ctx *macaron.Context, opts private.HookOptions) {
|
||||
wasEmpty = repo.IsEmpty
|
||||
}
|
||||
|
||||
option := repo_service.PushUpdateOptions{
|
||||
option := repo_module.PushUpdateOptions{
|
||||
RefFullName: refFullName,
|
||||
OldCommitID: opts.OldCommitIDs[i],
|
||||
NewCommitID: opts.NewCommitIDs[i],
|
||||
|
@@ -120,7 +120,7 @@ func RestoreBranchPost(ctx *context.Context) {
|
||||
|
||||
// Don't return error below this
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
&repo_module.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + deletedBranch.Name,
|
||||
OldCommitID: git.EmptySHA,
|
||||
NewCommitID: deletedBranch.Commit,
|
||||
@@ -157,7 +157,7 @@ func deleteBranch(ctx *context.Context, branchName string) error {
|
||||
|
||||
// Don't return error below this
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
&repo_module.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + branchName,
|
||||
OldCommitID: commit.ID.String(),
|
||||
NewCommitID: git.EmptySHA,
|
||||
|
@@ -22,6 +22,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/git"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/notification"
|
||||
repo_module "code.gitea.io/gitea/modules/repository"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/structs"
|
||||
"code.gitea.io/gitea/modules/upload"
|
||||
@@ -1185,7 +1186,7 @@ func CleanUpPullRequest(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if err := repo_service.PushUpdate(
|
||||
&repo_service.PushUpdateOptions{
|
||||
&repo_module.PushUpdateOptions{
|
||||
RefFullName: git.BranchPrefix + pr.HeadBranch,
|
||||
OldCommitID: branchCommitID,
|
||||
NewCommitID: git.EmptySHA,
|
||||
|
Reference in New Issue
Block a user