mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Add API endpoint to get changed files of a PR (#21177)
This adds an api endpoint `/files` to PRs that allows to get a list of changed files. built upon #18228, reviews there are included closes https://github.com/go-gitea/gitea/issues/654 Co-authored-by: Anton Bracke <anton@ju60.de> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		@@ -95,3 +95,16 @@ type EditPullRequestOption struct {
 | 
			
		||||
	RemoveDeadline      *bool      `json:"unset_due_date"`
 | 
			
		||||
	AllowMaintainerEdit *bool      `json:"allow_maintainer_edit"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ChangedFile store information about files affected by the pull request
 | 
			
		||||
type ChangedFile struct {
 | 
			
		||||
	Filename         string `json:"filename"`
 | 
			
		||||
	PreviousFilename string `json:"previous_filename,omitempty"`
 | 
			
		||||
	Status           string `json:"status"`
 | 
			
		||||
	Additions        int    `json:"additions"`
 | 
			
		||||
	Deletions        int    `json:"deletions"`
 | 
			
		||||
	Changes          int    `json:"changes"`
 | 
			
		||||
	HTMLURL          string `json:"html_url,omitempty"`
 | 
			
		||||
	ContentsURL      string `json:"contents_url,omitempty"`
 | 
			
		||||
	RawURL           string `json:"raw_url,omitempty"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user