mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-31 21:12:51 +09:00
feat: add IsForkPullRequest
This commit is contained in:
@ -418,6 +418,11 @@ func (pr *PullRequest) IsAncestor() bool {
|
||||
return pr.Status == PullRequestStatusAncestor
|
||||
}
|
||||
|
||||
// IsFromFork return true if this PR is from a fork.
|
||||
func (pr *PullRequest) IsFromFork() bool {
|
||||
return pr.HeadRepoID != pr.BaseRepoID
|
||||
}
|
||||
|
||||
// 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