Skip to content

Commit

Permalink
Revert "Avoid 0 new commits messages to be send (go-gitea#11082)" (go…
Browse files Browse the repository at this point in the history
…-gitea#11397)

This reverts commit 6034f8b.
  • Loading branch information
zeripath authored and Yohann Delafollye committed Jul 31, 2020
1 parent d6202f8 commit 5e4510e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/repofiles/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
}

Expand Down

0 comments on commit 5e4510e

Please sign in to comment.