Fix checks in PR for empty commits (#20290) (#20352)

Backport #20290

* Fix #19603
* fill HeadCommitID in PullRequest
* compare real commits ID as check for merging


Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Ing. Jaroslav Šafka 2022-07-13 19:36:23 +02:00 committed by GitHub
parent 66686f6d0e
commit 92a43d577d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 9 deletions

View file

@ -89,7 +89,7 @@ func CheckPullMergable(stdCtx context.Context, doer *user_model.User, perm *acce
return ErrIsWorkInProgress
}
if !pr.CanAutoMerge() {
if !pr.CanAutoMerge() && !pr.IsEmpty() {
return ErrNotMergableState
}