mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Fix stange behavior of DownloadPullDiffOrPatch in incorect index (#17223)
Fix GetPullRequestByIndex by validate index > 1 Signed-off-by: Danila Kryukov <pricly_yellow@dismail.de> Co-authored-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
		| @@ -522,6 +522,9 @@ func GetLatestPullRequestByHeadInfo(repoID int64, branch string) (*PullRequest, | ||||
|  | ||||
| // GetPullRequestByIndex returns a pull request by the given index | ||||
| func GetPullRequestByIndex(repoID, index int64) (*PullRequest, error) { | ||||
| 	if index < 1 { | ||||
| 		return nil, ErrPullRequestNotExist{} | ||||
| 	} | ||||
| 	pr := &PullRequest{ | ||||
| 		BaseRepoID: repoID, | ||||
| 		Index:      index, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user