aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/gogits
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-01 17:50:11 -0400
committerUnknwon <u@gogs.io>2017-04-01 17:50:11 -0400
commitb3ac33cbcfba182c037e1c8c393f7536e5b7445d (patch)
tree8d54ac22533938c16204b24daa4c09b9cb0c4517 /vendor/github.com/gogits
parent3b941628039b76d19e6511c8083d5c7ea4ae27f3 (diff)
vendor: update github.com/gogits/git-module
Diffstat (limited to 'vendor/github.com/gogits')
-rw-r--r--vendor/github.com/gogits/git-module/repo.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/github.com/gogits/git-module/repo.go b/vendor/github.com/gogits/git-module/repo.go
index 7a8e872b..02f264c1 100644
--- a/vendor/github.com/gogits/git-module/repo.go
+++ b/vendor/github.com/gogits/git-module/repo.go
@@ -15,6 +15,7 @@ import (
"time"
"github.com/Unknwon/com"
+ "github.com/mcuadros/go-version"
)
// Repository represents a Git repository.
@@ -248,6 +249,10 @@ const (
// GetRepoSize returns disk usage report of repository in given path.
func GetRepoSize(repoPath string) (*CountObject, error) {
+ if version.Compare(gitVersion, "1.8.3", "<") {
+ return nil, ErrUnsupportedVersion{"1.8.3"}
+ }
+
cmd := NewCommand("count-objects", "-v")
stdout, err := cmd.RunInDir(repoPath)
if err != nil {
@@ -262,7 +267,7 @@ func GetRepoSize(repoPath string) (*CountObject, error) {
case strings.HasPrefix(line, _STAT_SIZE):
countObject.Size = com.StrTo(line[6:]).MustInt64() * 1024
case strings.HasPrefix(line, _STAT_IN_PACK):
- countObject.InPack = com.StrTo(line[9:]).MustInt64() * 1024
+ countObject.InPack = com.StrTo(line[9:]).MustInt64()
case strings.HasPrefix(line, _STAT_PACKS):
countObject.Packs = com.StrTo(line[7:]).MustInt64()
case strings.HasPrefix(line, _STAT_SIZE_PACK):