summaryrefslogtreecommitdiffstats
path: root/modules/repofiles
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-05-13 08:50:56 +0100
committerGitHub <noreply@github.com>2020-05-13 10:50:56 +0300
commit8d212f778cf92e97c0e12b514d980982294e5675 (patch)
treed48b4144d61ab0a80efd6b0a4fd0fbc22eb142e6 /modules/repofiles
parente9dc3bcb7990f68852de1ba8d6b0f714ec68c048 (diff)
downloadgitea-8d212f778cf92e97c0e12b514d980982294e5675.tar.gz
gitea-8d212f778cf92e97c0e12b514d980982294e5675.zip
Revert "Avoid 0 new commits messages to be send (#11082)" (#11397)
This reverts commit 6034f8bcaaa5348fee775d2307ff03162130a088.
Diffstat (limited to 'modules/repofiles')
-rw-r--r--modules/repofiles/action.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go
index 19765a7477..44ca285ef0 100644
--- a/modules/repofiles/action.go
+++ b/modules/repofiles/action.go
@@ -249,12 +249,12 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
IsPrivate: repo.IsPrivate,
}
+ var isHookEventPush = true
switch opType {
case models.ActionCommitRepo: // Push
if opts.IsNewBranch() {
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
}
- notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
case models.ActionDeleteBranch: // Delete Branch
notification.NotifyDeleteRef(pusher, repo, "branch", opts.RefFullName)
@@ -263,6 +263,12 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
case models.ActionDeleteTag: // Delete Tag
notification.NotifyDeleteRef(pusher, repo, "tag", opts.RefFullName)
+ default:
+ isHookEventPush = false
+ }
+
+ if isHookEventPush {
+ notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
}
}