mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Migrate reviews when migrating repository from github (#9463)
* fix typo * Migrate reviews when migrating repository from github * fix lint * Added test and migration when external user login * fix test * fix commented state * Some improvements * fix bug when get pull request and ref original author on code comments * Fix migrated line; Added comment for review * Don't load all pull requests attributes * Fix typo * wrong change copy head * fix tests * fix reactions * Fix test * fix fmt * fix review comment reactions
This commit is contained in:
		@@ -655,6 +655,19 @@ func GetPullRequestByID(id int64) (*PullRequest, error) {
 | 
			
		||||
	return getPullRequestByID(x, id)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetPullRequestByIssueIDWithNoAttributes returns pull request with no attributes loaded by given issue ID.
 | 
			
		||||
func GetPullRequestByIssueIDWithNoAttributes(issueID int64) (*PullRequest, error) {
 | 
			
		||||
	var pr PullRequest
 | 
			
		||||
	has, err := x.Where("issue_id = ?", issueID).Get(&pr)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	if !has {
 | 
			
		||||
		return nil, ErrPullRequestNotExist{0, issueID, 0, 0, "", ""}
 | 
			
		||||
	}
 | 
			
		||||
	return &pr, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func getPullRequestByIssueID(e Engine, issueID int64) (*PullRequest, error) {
 | 
			
		||||
	pr := &PullRequest{
 | 
			
		||||
		IssueID: issueID,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user