mirror of
https://github.com/go-gitea/gitea
synced 2025-07-21 09:48:37 +00:00
Updates vendor/code.gitea.io/git (#6286)
This commit is contained in:
committed by
techknowlogick
parent
7c205607b5
commit
50631b5ac3
9
vendor/code.gitea.io/git/repo_commit.go
generated
vendored
9
vendor/code.gitea.io/git/repo_commit.go
generated
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user