diff --git a/services/repository/branch.go b/services/repository/branch.go index 5280856d55..f1509c9fbd 100644 --- a/services/repository/branch.go +++ b/services/repository/branch.go @@ -558,12 +558,7 @@ func UpdateBranch(ctx context.Context, repo *repo_model.Repository, doer *user_m if isForcePush || force { pushOpts.Force = true } - - if err := git.Push(ctx, repo.RepoPath(), pushOpts); err != nil { - return err - } - - return nil + return gitrepo.Push(ctx, repo, pushOpts) } var ErrBranchIsDefault = util.ErrorWrap(util.ErrPermissionDenied, "branch is default")