mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-28 16:47:01 +09:00
feat: add IsForkPullRequest
This commit is contained in:
1 parent
6ad8bddabf
commit
fdd3c0434e
6 files changed
+186
-172
No files matched your search
@@ -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