diff options
Diffstat (limited to 'modules/git/repo_commit.go')
-rw-r--r-- | modules/git/repo_commit.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go index 2b780feb5c..153a116b06 100644 --- a/modules/git/repo_commit.go +++ b/modules/git/repo_commit.go @@ -84,6 +84,9 @@ func (repo *Repository) GetCommitByPath(relpath string) (*Commit, error) { if err != nil { return nil, err } + if len(commits) == 0 { + return nil, ErrNotExist{ID: relpath} + } return commits[0], nil } |