Pārlūkot izejas kodu

Revert "Avoid 0 new commits messages to be send (#11082)" (#11397)

This reverts commit 6034f8bcaa.
tags/v1.13.0-dev
zeripath pirms 4 gadiem
vecāks
revīzija
8d212f778c
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 7 papildinājumiem un 1 dzēšanām
  1. 7
    1
      modules/repofiles/action.go

+ 7
- 1
modules/repofiles/action.go Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt