diff options
author | 6543 <6543@obermui.de> | 2020-12-25 09:59:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-25 11:59:32 +0200 |
commit | a19447aed128ecadfcd938d6a80cd4951af1f4ce (patch) | |
tree | 6312bf946d601aab29731645a4777feeaea66036 /modules/git | |
parent | 04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff) | |
download | gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip |
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models
* dont use "com.ToStr()"
* replace "com.ToStr" with "fmt.Sprint" where its easy to do
* more refactor
* fix test
* just "proxy" Copy func for now
* as per @lunny
Diffstat (limited to 'modules/git')
-rw-r--r-- | modules/git/repo.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go index e824dcc3f2..515899ab04 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -15,8 +15,6 @@ import ( "strconv" "strings" "time" - - "github.com/unknwon/com" ) // GPGSettings represents the default GPG settings for this repository @@ -309,21 +307,24 @@ func parseSize(objects string) *CountObject { for _, line := range strings.Split(objects, "\n") { switch { case strings.HasPrefix(line, statCount): - repoSize.Count = com.StrTo(line[7:]).MustInt64() + repoSize.Count, _ = strconv.ParseInt(line[7:], 10, 64) case strings.HasPrefix(line, statSize): - repoSize.Size = com.StrTo(line[6:]).MustInt64() * 1024 + repoSize.Size, _ = strconv.ParseInt(line[6:], 10, 64) + repoSize.Size *= 1024 case strings.HasPrefix(line, statInpack): - repoSize.InPack = com.StrTo(line[9:]).MustInt64() + repoSize.InPack, _ = strconv.ParseInt(line[9:], 10, 64) case strings.HasPrefix(line, statPacks): - repoSize.Packs = com.StrTo(line[7:]).MustInt64() + repoSize.Packs, _ = strconv.ParseInt(line[7:], 10, 64) case strings.HasPrefix(line, statSizePack): - repoSize.SizePack = com.StrTo(line[11:]).MustInt64() * 1024 + repoSize.Count, _ = strconv.ParseInt(line[11:], 10, 64) + repoSize.Count *= 1024 case strings.HasPrefix(line, statPrunePackage): - repoSize.PrunePack = com.StrTo(line[16:]).MustInt64() + repoSize.PrunePack, _ = strconv.ParseInt(line[16:], 10, 64) case strings.HasPrefix(line, statGarbage): - repoSize.Garbage = com.StrTo(line[9:]).MustInt64() + repoSize.Garbage, _ = strconv.ParseInt(line[9:], 10, 64) case strings.HasPrefix(line, statSizeGarbage): - repoSize.SizeGarbage = com.StrTo(line[14:]).MustInt64() * 1024 + repoSize.SizeGarbage, _ = strconv.ParseInt(line[14:], 10, 64) + repoSize.SizeGarbage *= 1024 } } return repoSize |