Ignore temporary files for directory size (#28265)

Co-authored-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
Earl Warren 2023-11-28 22:53:21 +01:00 committed by GitHub
parent 05b8023667
commit cb8298b717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -167,7 +167,11 @@ func getDirectorySize(path string) (int64, error) {
}
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
}
f, err := info.Info()