mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	When transferring ownership of a repo to a different user/org, create a repo redirect that points to the new location in the same way that is done when a repo is renamed. Signed-off-by: James E. Blair <jeblair@redhat.com>
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							525f03306f
						
					
				
				
					commit
					48c101affe
				
			@@ -204,7 +204,7 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
 | 
			
		||||
	redirectPath := strings.Replace(
 | 
			
		||||
		ctx.Req.URL.Path,
 | 
			
		||||
		fmt.Sprintf("%s/%s", ownerName, previousRepoName),
 | 
			
		||||
		fmt.Sprintf("%s/%s", ownerName, repo.Name),
 | 
			
		||||
		fmt.Sprintf("%s/%s", repo.MustOwnerName(), repo.Name),
 | 
			
		||||
		1,
 | 
			
		||||
	)
 | 
			
		||||
	ctx.Redirect(redirectPath)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user