From b08c16f3c92ce88eec9df28593d2e50a406275c5 Mon Sep 17 00:00:00 2001 From: aaaa Date: Fri, 9 Sep 2016 16:29:25 +0200 Subject: [PATCH] Fix size because all size in git count-objects are in KiB (https://git-scm.com/docs/git-count-objects) and not byte as I thought --- models/repo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/models/repo.go b/models/repo.go index 11bf9a37d..ee34ed4a5 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1765,12 +1765,15 @@ func ParseSize(reader io.Reader) (*CountObject, error) { repoSize.Count, err = strconv.Atoi(line[7:]) case strings.HasPrefix(line, STAT_SIZE): repoSize.Size, err = strconv.ParseInt(line[6:], 10, 64) + repoSize.Size = repoSize.Size * 1024 case strings.HasPrefix(line, STAT_INPACK): repoSize.InPack, err = strconv.ParseInt(line[9:], 10, 64) + repoSize.InPack = repoSize.InPack * 1024 case strings.HasPrefix(line, STAT_PACKS): repoSize.Packs, err = strconv.Atoi(line[7:]) case strings.HasPrefix(line, STAT_SIZEPACK): repoSize.SizePack, err = strconv.ParseInt(line[11:], 10, 64) + repoSize.SizePack = repoSize.SizePack * 1024 case strings.HasPrefix(line, STAT_PRUNEPACKAGE): repoSize.PrunePack, err = strconv.Atoi(line[16:]) case strings.HasPrefix(line, STAT_GARBAGE):