diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-10-31 05:59:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 22:59:02 +0100 |
commit | 4df2ed29f28194513c59733e369152b8f8bc1d36 (patch) | |
tree | 3bb0604e902390f37e2c9a8104f4ccaf495b4291 /routers | |
parent | dd12384f224e98a130511ebc9ffcfb44ead0e736 (diff) | |
download | gitea-4df2ed29f28194513c59733e369152b8f8bc1d36.tar.gz gitea-4df2ed29f28194513c59733e369152b8f8bc1d36.zip |
Refactor: Move PushUpdateOptions (#13363)
Co-authored-by: Antoine GIRARD <sapk@users.noreply.github.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/branch.go | 2 | ||||
-rw-r--r-- | routers/private/hook.go | 5 | ||||
-rw-r--r-- | routers/repo/branch.go | 4 | ||||
-rw-r--r-- | routers/repo/pull.go | 3 |
4 files changed, 8 insertions, 6 deletions
diff --git a/routers/api/v1/repo/branch.go b/routers/api/v1/repo/branch.go index 50ca3977a5..384225d742 100644 --- a/routers/api/v1/repo/branch.go +++ b/routers/api/v1/repo/branch.go @@ -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, diff --git a/routers/private/hook.go b/routers/private/hook.go index a2033fc1dd..dac3940756 100644 --- a/routers/private/hook.go +++ b/routers/private/hook.go @@ -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], diff --git a/routers/repo/branch.go b/routers/repo/branch.go index cd18f66777..81e8916af2 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -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, diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 1b3f835e4f..0ea6ec33de 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -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, |