Skip to content

Commit 74a5d49

Browse files
author
Gusted
authored
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.
1 parent 637c3ec commit 74a5d49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/util/path.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func EnsureAbsolutePath(path, absoluteBase string) string {
2424
return filepath.Join(absoluteBase, path)
2525
}
2626

27-
const notRegularFileMode os.FileMode = os.ModeDir | os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice | os.ModeCharDevice | os.ModeIrregular
27+
const notRegularFileMode os.FileMode = os.ModeSymlink | os.ModeNamedPipe | os.ModeSocket | os.ModeDevice | os.ModeCharDevice | os.ModeIrregular
2828

29-
// GetDirectorySize returns the dumb disk consumption for a given path
29+
// GetDirectorySize returns the disk consumption for a given path
3030
func GetDirectorySize(path string) (int64, error) {
3131
var size int64
3232
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {

0 commit comments

Comments
 (0)