summaryrefslogtreecommitdiffstats
path: root/modules/repofiles
diff options
context:
space:
mode:
authorCornel <github@codejuggle.dj>2020-04-18 23:02:59 +0300
committerGitHub <noreply@github.com>2020-04-18 21:02:59 +0100
commit6034f8bcaaa5348fee775d2307ff03162130a088 (patch)
tree210a649c5edb21f72ffd7d8af8335b660d40c426 /modules/repofiles
parent4f597b1866954ff94999a52af1a41fed06f0143e (diff)
downloadgitea-6034f8bcaaa5348fee775d2307ff03162130a088.tar.gz
gitea-6034f8bcaaa5348fee775d2307ff03162130a088.zip
Avoid 0 new commits messages to be send (#11082)
Fixes #10498
Diffstat (limited to 'modules/repofiles')
-rw-r--r--modules/repofiles/action.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/modules/repofiles/action.go b/modules/repofiles/action.go
index 44ca285ef0..19765a7477 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,12 +263,6 @@ 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)
}
}