From 8d091ec062815dfd885c540d107ac2e07ed6b880 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 3 Jun 2018 20:26:29 +0800 Subject: vendor: update github.com/gogs/git-module --- vendor/github.com/gogs/git-module/repo_commit.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'vendor/github.com/gogs/git-module/repo_commit.go') diff --git a/vendor/github.com/gogs/git-module/repo_commit.go b/vendor/github.com/gogs/git-module/repo_commit.go index 1ac03387..efbc8700 100644 --- a/vendor/github.com/gogs/git-module/repo_commit.go +++ b/vendor/github.com/gogs/git-module/repo_commit.go @@ -126,15 +126,10 @@ func (repo *Repository) getCommit(id sha1) (*Commit, error) { // GetCommit returns commit object of by ID string. func (repo *Repository) GetCommit(commitID string) (*Commit, error) { - if len(commitID) != 40 { - var err error - commitID, err = NewCommand("rev-parse", commitID).RunInDir(repo.Path) - if err != nil { - if strings.Contains(err.Error(), "exit status 128") { - return nil, ErrNotExist{commitID, ""} - } - return nil, err - } + var err error + commitID, err = GetFullCommitID(repo.Path, commitID) + if err != nil { + return nil, fmt.Errorf("GetCommitFullID: %v", err) } id, err := NewIDFromString(commitID) if err != nil { -- cgit v1.2.3