Updates vendor/code.gitea.io/git (#6286)
This commit is contained in:
parent
7c205607b5
commit
50631b5ac3
2 changed files with 12 additions and 4 deletions
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue