diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/gogits/git-module/git.go | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/git-module/repo.go | 15 | ||||
-rw-r--r-- | vendor/vendor.json | 6 |
3 files changed, 19 insertions, 4 deletions
diff --git a/vendor/github.com/gogits/git-module/git.go b/vendor/github.com/gogits/git-module/git.go index 538e66d7..f56d054e 100644 --- a/vendor/github.com/gogits/git-module/git.go +++ b/vendor/github.com/gogits/git-module/git.go @@ -10,7 +10,7 @@ import ( "time" ) -const _VERSION = "0.6.0" +const _VERSION = "0.6.1" func Version() string { return _VERSION diff --git a/vendor/github.com/gogits/git-module/repo.go b/vendor/github.com/gogits/git-module/repo.go index aef9f385..ca4805f5 100644 --- a/vendor/github.com/gogits/git-module/repo.go +++ b/vendor/github.com/gogits/git-module/repo.go @@ -278,3 +278,18 @@ func GetRepoSize(repoPath string) (*CountObject, error) { return countObject, nil } + +// GetLatestCommitDate returns the date of latest commit of repository. +// If branch is empty, it returns the latest commit across all branches. +func GetLatestCommitDate(repoPath, branch string) (time.Time, error) { + cmd := NewCommand("for-each-ref", "--count=1", "--sort=-committerdate", "--format=%(committerdate:iso8601)") + if len(branch) > 0 { + cmd.AddArguments("refs/heads/" + branch) + } + stdout, err := cmd.RunInDir(repoPath) + if err != nil { + return time.Time{}, err + } + + return time.Parse("2006-01-02 15:04:05 -0700", strings.TrimSpace(stdout)) +} diff --git a/vendor/vendor.json b/vendor/vendor.json index bbfa8356..0118a017 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -177,10 +177,10 @@ "revisionTime": "2016-08-10T03:50:02Z" }, { - "checksumSHA1": "XT0fyELKMKgb4XeMAtIrmi4SetM=", + "checksumSHA1": "OmDPIa3NWPpl/rItpYC/Ig/m/gI=", "path": "github.com/gogits/git-module", - "revision": "2a496cad1f36aed60b14844b33b68eb3edfc2718", - "revisionTime": "2017-04-04T05:59:12Z" + "revision": "1ebf9618c02c9480312bb55bccda7886c8d4caac", + "revisionTime": "2017-04-07T00:57:10Z" }, { "checksumSHA1": "D2kVXl0QpIw6t3891Sl7IM9wL+w=", |