aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/git
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-03-11 12:01:00 -0600
committertechknowlogick <matti@mdranta.net>2019-03-11 14:01:00 -0400
commit50631b5ac3ea06e167eca42c564ff4d89568ae99 (patch)
tree8a809b110af079118a5d5ed39e6ae5b3dd3851e1 /vendor/code.gitea.io/git
parent7c205607b5c3fa6e2cf91769588263a5c94e361a (diff)
downloadgitea-50631b5ac3ea06e167eca42c564ff4d89568ae99.tar.gz
gitea-50631b5ac3ea06e167eca42c564ff4d89568ae99.zip
Updates vendor/code.gitea.io/git (#6286)
Diffstat (limited to 'vendor/code.gitea.io/git')
-rw-r--r--vendor/code.gitea.io/git/repo_commit.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/code.gitea.io/git/repo_commit.go b/vendor/code.gitea.io/git/repo_commit.go
index fbb8f97a1d..2d9f5bdbf8 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 {