Skip to content

Commit 6034f8b

Browse files
authored
Avoid 0 new commits messages to be send (#11082)
Fixes #10498
1 parent 4f597b1 commit 6034f8b

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

modules/repofiles/action.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
249249
IsPrivate: repo.IsPrivate,
250250
}
251251

252-
var isHookEventPush = true
253252
switch opType {
254253
case models.ActionCommitRepo: // Push
255254
if opts.IsNewBranch() {
256255
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
257256
}
257+
notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
258258
case models.ActionDeleteBranch: // Delete Branch
259259
notification.NotifyDeleteRef(pusher, repo, "branch", opts.RefFullName)
260260

@@ -263,12 +263,6 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
263263

264264
case models.ActionDeleteTag: // Delete Tag
265265
notification.NotifyDeleteRef(pusher, repo, "tag", opts.RefFullName)
266-
default:
267-
isHookEventPush = false
268-
}
269-
270-
if isHookEventPush {
271-
notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
272266
}
273267
}
274268

0 commit comments

Comments
 (0)