Skip to content

Commit

Permalink
Ignore temporary files for directory size (#28265)
Browse files Browse the repository at this point in the history
Co-authored-by: Gusted <postmaster@gusted.xyz>
  • Loading branch information
earl-warren and Gusted committed Nov 28, 2023
1 parent 05b8023 commit cb8298b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/repository/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cb8298b

Please sign in to comment.