mirror of https://github.com/gogs/gogs.git
vendor: update github.com/gogits/git-module
parent
ab42671c63
commit
c07899701a
|
@ -335,12 +335,7 @@ func (repo *Repository) mustOwner(e Engine) *User {
|
|||
func (repo *Repository) UpdateSize() error {
|
||||
countObject, err := git.GetRepoSize(repo.RepoPath())
|
||||
if err != nil {
|
||||
if !git.IsErrUnsupportedVersion(err) {
|
||||
return fmt.Errorf("GetRepoSize: %v", err)
|
||||
}
|
||||
|
||||
log.Warn("Get repository size is not supported by the Git version on server")
|
||||
return nil
|
||||
return fmt.Errorf("GetRepoSize: %v", err)
|
||||
}
|
||||
|
||||
repo.Size = countObject.Size + countObject.SizePack
|
||||
|
|
|
@ -5,7 +5,7 @@ Package git-module is a Go module for Git access through shell commands.
|
|||
## Limitations
|
||||
|
||||
- Go version must be at least **1.4**.
|
||||
- Git version must be no less than **1.7.1**, and greater than or equal to **1.8.0** is recommended.
|
||||
- Git version must be no less than **1.7.1**, and greater than or equal to **1.8.3** is recommended.
|
||||
- For Windows users, try use as new a version as possible.
|
||||
|
||||
## License
|
||||
|
|
|
@ -15,7 +15,6 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
"github.com/mcuadros/go-version"
|
||||
)
|
||||
|
||||
// Repository represents a Git repository.
|
||||
|
@ -249,10 +248,6 @@ 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 {
|
||||
|
|
|
@ -159,10 +159,10 @@
|
|||
"revisionTime": "2016-08-10T03:50:02Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "b7QGk00tV65zoJ2LxNOv+/ShNb0=",
|
||||
"checksumSHA1": "WVDLV+YcA77fg1kgddSinycf3Do=",
|
||||
"path": "github.com/gogits/git-module",
|
||||
"revision": "187ba03b3c392ed6e6af3985f0bad0c2120219ca",
|
||||
"revisionTime": "2017-04-01T21:46:49Z"
|
||||
"revision": "f4026b57acf35d799d5dec95066f3a10c572604e",
|
||||
"revisionTime": "2017-04-03T19:07:43Z"
|
||||
},
|
||||
{
|
||||
"checksumSHA1": "D2kVXl0QpIw6t3891Sl7IM9wL+w=",
|
||||
|
|
Loading…
Reference in New Issue