This repository was archived by the owner on Apr 12, 2019. It is now read-only.
Commit ceeb8f4
committed
GetCommit() returns a ErrNotExist if short commit ID does not exists
Currently, GetCommit() returns a generic error if a short commit ID
does not exists in a repository.
When a commit is not found by git-rev-parse, it returns an errors
which contains "fatal: ambiguous argument". GetCommit() now search if
the error contains this string, and, if it does, returns an
ErrNotExist.
The idea is to allow commits to be accessed from gitea with a short
commit ID. Without this change, it would return a 500 Internal Server
Error when a short ID does not exists in the repository.
Signed-off-by: Alban Gruin <alban@pa1ch.fr>1 parent dac1986 commit ceeb8f4
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
128 | 131 | | |
129 | 132 | | |
130 | 133 | | |
| |||
0 commit comments