mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Ignore temporary files for directory size (#28265)
Co-authored-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
		@@ -167,7 +167,11 @@ func getDirectorySize(path string) (int64, error) {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			return err
 | 
								return err
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if info.IsDir() {
 | 
					
 | 
				
			||||||
 | 
							fileName := info.Name()
 | 
				
			||||||
 | 
							// Ignore temporary Git files as they will like be missing once info.Info is
 | 
				
			||||||
 | 
							// called and cause a disrupt to the whole operation.
 | 
				
			||||||
 | 
							if info.IsDir() || strings.HasSuffix(fileName, ".lock") || strings.HasPrefix(filepath.Base(fileName), "tmp_graph") {
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		f, err := info.Info()
 | 
							f, err := info.Info()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user