|
|
@ -101,7 +101,11 @@ l: |
|
|
|
sig, err := newGPGSignatureFromCommitline(data, (nextline+1)+sigindex, true) |
|
|
|
sig, err := newGPGSignatureFromCommitline(data, (nextline+1)+sigindex, true) |
|
|
|
if err == nil && sig != nil { |
|
|
|
if err == nil && sig != nil { |
|
|
|
// remove signature from commit message
|
|
|
|
// remove signature from commit message
|
|
|
|
|
|
|
|
if sigindex == 0 { |
|
|
|
|
|
|
|
cm = "" |
|
|
|
|
|
|
|
} else { |
|
|
|
cm = cm[:sigindex-1] |
|
|
|
cm = cm[:sigindex-1] |
|
|
|
|
|
|
|
} |
|
|
|
commit.Signature = sig |
|
|
|
commit.Signature = sig |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -153,13 +157,14 @@ func (repo *Repository) getCommit(id SHA1) (*Commit, error) { |
|
|
|
func (repo *Repository) GetCommit(commitID string) (*Commit, error) { |
|
|
|
func (repo *Repository) GetCommit(commitID string) (*Commit, error) { |
|
|
|
if len(commitID) != 40 { |
|
|
|
if len(commitID) != 40 { |
|
|
|
var err error |
|
|
|
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 err != nil { |
|
|
|
if strings.Contains(err.Error(), "unknown revision or path") { |
|
|
|
if strings.Contains(err.Error(), "unknown revision or path") { |
|
|
|
return nil, ErrNotExist{commitID, ""} |
|
|
|
return nil, ErrNotExist{commitID, ""} |
|
|
|
} |
|
|
|
} |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
commitID = actualCommitID |
|
|
|
} |
|
|
|
} |
|
|
|
id, err := NewIDFromString(commitID) |
|
|
|
id, err := NewIDFromString(commitID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|