Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit 4ba06a0

Browse files
committed
GetCommit(): change the comparison for short commit messages
`fatal: ambiguous argument` can be the beginning of two errors in git. This changes the comparison to something less ambiguous.
1 parent ceeb8f4 commit 4ba06a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repo_commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (repo *Repository) GetCommit(commitID string) (*Commit, error) {
125125
var err error
126126
commitID, err = NewCommand("rev-parse", commitID).RunInDir(repo.Path)
127127
if err != nil {
128-
if strings.Contains(err.Error(), "fatal: ambiguous argument") {
128+
if strings.Contains(err.Error(), "unknown revision or path") {
129129
return nil, ErrNotExist{commitID, ""}
130130
}
131131
return nil, err

0 commit comments

Comments
 (0)