diff options
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/branch.go | 13 | ||||
-rw-r--r-- | routers/repo/pull.go | 7 |
2 files changed, 7 insertions, 13 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index 4d8b9158fe..0ca77cbf6f 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -19,6 +19,7 @@ import ( repo_module "code.gitea.io/gitea/modules/repository" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/utils" + repo_service "code.gitea.io/gitea/services/repository" ) const ( @@ -118,10 +119,8 @@ func RestoreBranchPost(ctx *context.Context) { } // Don't return error below this - if err := repofiles.PushUpdate( - ctx.Repo.Repository, - deletedBranch.Name, - repofiles.PushUpdateOptions{ + if err := repo_service.PushUpdate( + &repo_service.PushUpdateOptions{ RefFullName: git.BranchPrefix + deletedBranch.Name, OldCommitID: git.EmptySHA, NewCommitID: deletedBranch.Commit, @@ -157,10 +156,8 @@ func deleteBranch(ctx *context.Context, branchName string) error { } // Don't return error below this - if err := repofiles.PushUpdate( - ctx.Repo.Repository, - branchName, - repofiles.PushUpdateOptions{ + if err := repo_service.PushUpdate( + &repo_service.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 a19dbb5cb3..a6f7a70744 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -22,7 +22,6 @@ import ( "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" - "code.gitea.io/gitea/modules/repofiles" "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" @@ -1124,10 +1123,8 @@ func CleanUpPullRequest(ctx *context.Context) { return } - if err := repofiles.PushUpdate( - pr.HeadRepo, - pr.HeadBranch, - repofiles.PushUpdateOptions{ + if err := repo_service.PushUpdate( + &repo_service.PushUpdateOptions{ RefFullName: git.BranchPrefix + pr.HeadBranch, OldCommitID: branchCommitID, NewCommitID: git.EmptySHA, |