Browse Source

vendor: update github.com/gogits/git-module

Unknwon 8 years ago
parent
commit
b3ac33cbcf
2 changed files with 9 additions and 4 deletions
  1. 6 1
      vendor/github.com/gogits/git-module/repo.go
  2. 3 3
      vendor/vendor.json

+ 6 - 1
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):

+ 3 - 3
vendor/vendor.json

@@ -159,10 +159,10 @@
 			"revisionTime": "2016-08-10T03:50:02Z"
 		},
 		{
-			"checksumSHA1": "0BVytmK2I0QObcFqVyVWWU544DA=",
+			"checksumSHA1": "b7QGk00tV65zoJ2LxNOv+/ShNb0=",
 			"path": "github.com/gogits/git-module",
-			"revision": "e0ab95e3e61573e88bb808ae8052fd669324d80f",
-			"revisionTime": "2017-03-17T02:27:16Z"
+			"revision": "187ba03b3c392ed6e6af3985f0bad0c2120219ca",
+			"revisionTime": "2017-04-01T21:46:49Z"
 		},
 		{
 			"checksumSHA1": "D2kVXl0QpIw6t3891Sl7IM9wL+w=",