1
1
mirror of https://github.com/go-gitea/gitea synced 2025-09-28 03:28:13 +00:00

Avoid sending "0 new commits" webhook

Signed-off-by: Till Faelligen <tfaelligen@gmail.com>
This commit is contained in:
Till Faelligen
2020-07-11 13:09:06 +02:00
parent 8d081950e6
commit 1f47ccfacd
7 changed files with 28 additions and 0 deletions

View File

@@ -196,6 +196,10 @@ func getMSTeamsForkPayload(p *api.ForkPayload) (*MSTeamsPayload, error) {
}
func getMSTeamsPushPayload(p *api.PushPayload) (*MSTeamsPayload, error) {
if len(p.Commits) == 0 {
return nil, fmt.Errorf("no commits in payload")
}
var (
branchName = git.RefEndName(p.Ref)
commitDesc string