diff options
author | Earl Warren <109468362+earl-warren@users.noreply.github.com> | 2023-11-28 22:53:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-28 21:53:21 +0000 |
commit | cb8298b7178f5dde302604bfe34c658b725f16f8 (patch) | |
tree | a2caed57eb75a0523d3067851749613cb93986e7 /modules/repository | |
parent | 05b80236679b325b445d6c95a2e74937ad228a77 (diff) | |
download | gitea-cb8298b7178f5dde302604bfe34c658b725f16f8.tar.gz gitea-cb8298b7178f5dde302604bfe34c658b725f16f8.zip |
Ignore temporary files for directory size (#28265)
Co-authored-by: Gusted <postmaster@gusted.xyz>
Diffstat (limited to 'modules/repository')
-rw-r--r-- | modules/repository/create.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/repository/create.go b/modules/repository/create.go index 2dac35224e..153686089c 100644 --- a/modules/repository/create.go +++ b/modules/repository/create.go @@ -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() |