aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/push.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-07-20 15:18:52 +0800
committerGitHub <noreply@github.com>2023-07-20 15:18:52 +0800
commit01c04607c76391e09620c6f2475b722207d2ee73 (patch)
treeff1cdb3ef3b37f6e8ab3108999e1def1215414fe /services/repository/push.go
parentcf467119ffa82177258226fd04946a2105ee7aa0 (diff)
downloadgitea-01c04607c76391e09620c6f2475b722207d2ee73.tar.gz
gitea-01c04607c76391e09620c6f2475b722207d2ee73.zip
Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882)
Fix #25858 The option `dissmiss stale approvals` was listed on protected branch but never implemented. This PR fixes that. <img width="1006" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/60bfa968-4db7-4c24-b8be-2e5978f91bb9"> <img width="1021" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/8dabc14d-2dfe-40c2-94ed-24fcbf6e0e8f">
Diffstat (limited to 'services/repository/push.go')
-rw-r--r--services/repository/push.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/repository/push.go b/services/repository/push.go
index 8e4bab1562..8cff5f66b6 100644
--- a/services/repository/push.go
+++ b/services/repository/push.go
@@ -257,12 +257,12 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
commits.Commits = commits.Commits[:setting.UI.FeedMaxCommitNum]
}
- notification.NotifyPushCommits(ctx, pusher, repo, opts, commits)
-
if err = git_model.UpdateBranch(ctx, repo.ID, opts.PusherID, branch, newCommit); err != nil {
return fmt.Errorf("git_model.UpdateBranch %s:%s failed: %v", repo.FullName(), branch, err)
}
+ notification.NotifyPushCommits(ctx, pusher, repo, opts, commits)
+
// Cache for big repository
if err := CacheRef(graceful.GetManager().HammerContext(), repo, gitRepo, opts.RefFullName); err != nil {
log.Error("repo_module.CacheRef %s/%s failed: %v", repo.ID, branch, err)