From 50631b5ac3ea06e167eca42c564ff4d89568ae99 Mon Sep 17 00:00:00 2001 From: Richard Mahn Date: Mon, 11 Mar 2019 12:01:00 -0600 Subject: [PATCH] Updates vendor/code.gitea.io/git (#6286) --- Gopkg.lock | 7 +++++-- vendor/code.gitea.io/git/repo_commit.go | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index dae99b340..6a97f8915 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -3,11 +3,11 @@ [[projects]] branch = "master" - digest = "1:0f0ada42a7b1bd64794bf8fea917c2cd626d6b0539173e3704cd764b93eb5312" + digest = "1:e1fa64238b0a2dbf1edf98c4af8d1b8cb65179e286d7f28006b50fa9f508ee9d" name = "code.gitea.io/git" packages = ["."] pruneopts = "NUT" - revision = "8983773ac6fef49203e7ee8cdbfde3e118bc3421" + revision = "74d7c14dd4a3ed9c5def0dc3c1aeede399ddc5c5" [[projects]] branch = "master" @@ -1331,6 +1331,9 @@ "gopkg.in/ini.v1", "gopkg.in/ldap.v3", "gopkg.in/macaron.v1", + "gopkg.in/src-d/go-git.v4", + "gopkg.in/src-d/go-git.v4/config", + "gopkg.in/src-d/go-git.v4/plumbing", "gopkg.in/testfixtures.v2", "strk.kbt.io/projects/go/libravatar", ] diff --git a/vendor/code.gitea.io/git/repo_commit.go b/vendor/code.gitea.io/git/repo_commit.go index fbb8f97a1..2d9f5bdbf 100644 --- a/vendor/code.gitea.io/git/repo_commit.go +++ b/vendor/code.gitea.io/git/repo_commit.go @@ -101,7 +101,11 @@ l: sig, err := newGPGSignatureFromCommitline(data, (nextline+1)+sigindex, true) if err == nil && sig != nil { // remove signature from commit message - cm = cm[:sigindex-1] + if sigindex == 0 { + cm = "" + } else { + cm = cm[:sigindex-1] + } commit.Signature = sig } } @@ -153,13 +157,14 @@ func (repo *Repository) getCommit(id SHA1) (*Commit, error) { func (repo *Repository) GetCommit(commitID string) (*Commit, error) { if len(commitID) != 40 { var err error - commitID, err = NewCommand("rev-parse", commitID).RunInDir(repo.Path) + actualCommitID, err := NewCommand("rev-parse", commitID).RunInDir(repo.Path) if err != nil { if strings.Contains(err.Error(), "unknown revision or path") { return nil, ErrNotExist{commitID, ""} } return nil, err } + commitID = actualCommitID } id, err := NewIDFromString(commitID) if err != nil {