mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
* Fixes issue #19603 (Not able to merge commit in PR when branches content is same, but different commit id) * fill HeadCommitID in PullRequest * compare real commits ID as check for merging * based on @zeripath patch in #19738
This commit is contained in:
committed by
GitHub
parent
b7c6ec91ba
commit
8420c1bf4c
@ -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 {
|
||||
|
Reference in New Issue
Block a user