mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 14:31:02 +00:00 
			
		
		
		
	Backport #26290 by @Zettat123 Fixes #26270. Co-Author: @wxiaoguang Thanks @lunny for providing this solution As https://github.com/go-gitea/gitea/issues/26270#issuecomment-1661695151 said, at present we cannot get the names of changed files correctly when the `OldCommitID` is `EmptySHA`. In this PR, the `GetCommitFilesChanged` method is added and will be used to get the changed files by commit ID. References: - https://stackoverflow.com/a/424142 Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								8e07d53fe4
							
						
					
				
			
			
				commit
				
					
						a57568bad7
					
				
			
		
					 3 changed files with 50 additions and 3 deletions
				
			
		|  | @ -11,10 +11,10 @@ import ( | |||
| 	"strings" | ||||
| ) | ||||
| 
 | ||||
| // EmptySHA defines empty git SHA | ||||
| // EmptySHA defines empty git SHA (undefined, non-existent) | ||||
| const EmptySHA = "0000000000000000000000000000000000000000" | ||||
| 
 | ||||
| // EmptyTreeSHA is the SHA of an empty tree | ||||
| // EmptyTreeSHA is the SHA of an empty tree, the root of all git repositories | ||||
| const EmptyTreeSHA = "4b825dc642cb6eb9a060e54bf8d69288fbee4904" | ||||
| 
 | ||||
| // SHAFullLength is the full length of a git SHA | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue