forked from forgejo/forgejo
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:
parent
66686f6d0e
commit
92a43d577d
7 changed files with 58 additions and 9 deletions
|
@ -122,6 +122,7 @@ const (
|
|||
PullRequestStatusManuallyMerged
|
||||
PullRequestStatusError
|
||||
PullRequestStatusEmpty
|
||||
PullRequestStatusAncestor
|
||||
)
|
||||
|
||||
// PullRequestFlow the flow of pull request
|
||||
|
@ -423,6 +424,11 @@ func (pr *PullRequest) IsEmpty() bool {
|
|||
return pr.Status == PullRequestStatusEmpty
|
||||
}
|
||||
|
||||
// IsAncestor returns true if the Head Commit of this PR is an ancestor of the Base Commit
|
||||
func (pr *PullRequest) IsAncestor() bool {
|
||||
return pr.Status == PullRequestStatusAncestor
|
||||
}
|
||||
|
||||
// SetMerged sets a pull request to merged and closes the corresponding issue
|
||||
func (pr *PullRequest) SetMerged(ctx context.Context) (bool, error) {
|
||||
if pr.HasMerged {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue