mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Backport #16461 Unfortunately #16435 asserts the wrong error and should use os.LinkError not os.PathError. Fix #16439 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -64,7 +64,7 @@ func Rename(oldpath, newpath string) error {
 | 
			
		||||
		if err == nil {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
		unwrapped := err.(*os.PathError).Err
 | 
			
		||||
		unwrapped := err.(*os.LinkError).Err
 | 
			
		||||
		if unwrapped == syscall.EBUSY || unwrapped == syscall.ENOTEMPTY || unwrapped == syscall.EPERM || unwrapped == syscall.EMFILE || unwrapped == syscall.ENFILE {
 | 
			
		||||
			// try again
 | 
			
		||||
			<-time.After(100 * time.Millisecond)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user