Browse Source

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

pull/5254/merge
Unknwon 7 years ago
parent
commit
8d091ec062
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
  1. 16
      vendor/github.com/gogs/git-module/commit.go
  2. 2
      vendor/github.com/gogs/git-module/git.go
  3. 9
      vendor/github.com/gogs/git-module/repo_commit.go
  4. 6
      vendor/vendor.json

16
vendor/github.com/gogs/git-module/commit.go generated vendored

@ -303,3 +303,19 @@ func GetCommitFileStatus(repoPath, commitID string) (*CommitFileStatus, error) {
func (c *Commit) FileStatus() (*CommitFileStatus, error) { func (c *Commit) FileStatus() (*CommitFileStatus, error) {
return GetCommitFileStatus(c.repo.Path, c.ID.String()) return GetCommitFileStatus(c.repo.Path, c.ID.String())
} }
// GetFullCommitID returns full length (40) of commit ID by given short SHA in a repository.
func GetFullCommitID(repoPath, shortID string) (string, error) {
if len(shortID) >= 40 {
return shortID, nil
}
commitID, err := NewCommand("rev-parse", shortID).RunInDir(repoPath)
if err != nil {
if strings.Contains(err.Error(), "exit status 128") {
return "", ErrNotExist{shortID, ""}
}
return "", err
}
return strings.TrimSpace(commitID), nil
}

2
vendor/github.com/gogs/git-module/git.go generated vendored

@ -10,7 +10,7 @@ import (
"time" "time"
) )
const _VERSION = "0.6.5" const _VERSION = "0.6.6"
func Version() string { func Version() string {
return _VERSION return _VERSION

9
vendor/github.com/gogs/git-module/repo_commit.go generated vendored

@ -126,15 +126,10 @@ func (repo *Repository) getCommit(id sha1) (*Commit, error) {
// GetCommit returns commit object of by ID string. // GetCommit returns commit object of by ID string.
func (repo *Repository) GetCommit(commitID string) (*Commit, error) { func (repo *Repository) GetCommit(commitID string) (*Commit, error) {
if len(commitID) != 40 {
var err error var err error
commitID, err = NewCommand("rev-parse", commitID).RunInDir(repo.Path) commitID, err = GetFullCommitID(repo.Path, commitID)
if err != nil { if err != nil {
if strings.Contains(err.Error(), "exit status 128") { return nil, fmt.Errorf("GetCommitFullID: %v", err)
return nil, ErrNotExist{commitID, ""}
}
return nil, err
}
} }
id, err := NewIDFromString(commitID) id, err := NewIDFromString(commitID)
if err != nil { if err != nil {

6
vendor/vendor.json vendored

@ -207,10 +207,10 @@
"revisionTime": "2017-03-01T03:54:11Z" "revisionTime": "2017-03-01T03:54:11Z"
}, },
{ {
"checksumSHA1": "KNGYbPsHRTay+Mo08T0eWwqeOb4=", "checksumSHA1": "183Lk59tqgDzO3eZeer4g1w/hk0=",
"path": "github.com/gogs/git-module", "path": "github.com/gogs/git-module",
"revision": "483e6638258058b08679cf0c7010a13597de4978", "revision": "c64f3cabc82d33dfdb0cd47a5dda4e29368f3da2",
"revisionTime": "2018-05-27T13:41:17Z" "revisionTime": "2018-06-03T12:25:16Z"
}, },
{ {
"checksumSHA1": "MLO0PyrK2MUO6A7Z9PxWuu43C/A=", "checksumSHA1": "MLO0PyrK2MUO6A7Z9PxWuu43C/A=",

Loading…
Cancel
Save