1
0
Fork 0
forked from forgejo/forgejo

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

@ -145,6 +145,10 @@ func getMatrixReleasePayload(p *api.ReleasePayload, matrix *MatrixMeta) (*Matrix
}
func getMatrixPushPayload(p *api.PushPayload, matrix *MatrixMeta) (*MatrixPayloadUnsafe, error) {
if len(p.Commits) == 0 {
return nil, fmt.Errorf("no commits in payload")
}
var commitDesc string
if len(p.Commits) == 1 {