diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-06-10 19:35:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 19:35:13 +0800 |
commit | d93e6232e829a1ade1f9540a701061967aa7d61d (patch) | |
tree | dc55b077a6bcf70e85b7032e66da88bc88594e54 /routers/repo/branch.go | |
parent | b1be6fd31f6f9f1512de16cd93d30775319b3c75 (diff) | |
download | gitea-d93e6232e829a1ade1f9540a701061967aa7d61d.tar.gz gitea-d93e6232e829a1ade1f9540a701061967aa7d61d.zip |
Move PushUpdate dependency from models to repofiles (#6763)
* remove push_update
* move models.PushUpdate to repofiles.PushUpdate
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r-- | routers/repo/branch.go | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go index ae87aa5b3a..05d64fb4c8 100644 --- a/routers/repo/branch.go +++ b/routers/repo/branch.go @@ -131,15 +131,18 @@ func deleteBranch(ctx *context.Context, branchName string) error { } // Don't return error below this - if err := models.PushUpdate(branchName, models.PushUpdateOptions{ - RefFullName: git.BranchPrefix + branchName, - OldCommitID: commit.ID.String(), - NewCommitID: git.EmptySHA, - PusherID: ctx.User.ID, - PusherName: ctx.User.Name, - RepoUserName: ctx.Repo.Owner.Name, - RepoName: ctx.Repo.Repository.Name, - }); err != nil { + if err := repofiles.PushUpdate( + ctx.Repo.Repository, + branchName, + models.PushUpdateOptions{ + RefFullName: git.BranchPrefix + branchName, + OldCommitID: commit.ID.String(), + NewCommitID: git.EmptySHA, + PusherID: ctx.User.ID, + PusherName: ctx.User.Name, + RepoUserName: ctx.Repo.Owner.Name, + RepoName: ctx.Repo.Repository.Name, + }); err != nil { log.Error("Update: %v", err) } |