aboutsummaryrefslogtreecommitdiffstats
path: root/modules/util/path.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-01-03 23:24:12 +0000
committerGitHub <noreply@github.com>2022-01-03 23:24:12 +0000
commit74a5d49e866f6432f4ecb29011f0b7e87273b728 (patch)
tree2b50a45aca573d127995c5b37c411b6eec8a3242 /modules/util/path.go
parent637c3ec5d82f9d727724cc362aea37eeb2f64b40 (diff)
downloadgitea-74a5d49e866f6432f4ecb29011f0b7e87273b728.tar.gz
gitea-74a5d49e866f6432f4ecb29011f0b7e87273b728.zip
Include folders into size cost (#18158)
- Include folders for the disk consumption size, they should be included as they are also saved on the disk :) - Have a more accurate picture of the size of a repo. - Mostly they are the size of the file system's block size. E.g. 4Kb on Linux.
Diffstat (limited to 'modules/util/path.go')
-rw-r--r--modules/util/path.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/util/path.go b/modules/util/path.go
index cad50eddc2..f4acf92ba9 100644
--- a/modules/util/path.go
+++ b/modules/util/path.go
@@ -24,9 +24,9 @@ func EnsureAbsolutePath(path, absoluteBase string) string {
return filepath.Join(absoluteBase, path)
}
-const notRegularFileMode os.FileMode = os.ModeDir | os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice | os.ModeCharDevice | os.ModeIrregular
+const notRegularFileMode os.FileMode = os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice | os.ModeCharDevice | os.ModeIrregular
-// GetDirectorySize returns the dumb disk consumption for a given path
+// GetDirectorySize returns the disk consumption for a given path
func GetDirectorySize(path string) (int64, error) {
var size int64
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {