response 404 for diff/patch of a commit that not exist (#15221)
* response 404 for diff/patch of a commit that not exist fix #15217 Signed-off-by: a1012112796 <1012112796@qq.com> * Update routers/repo/commit.go Co-authored-by: silverwind <me@silverwind.io> * use ctx.NotFound() Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
parent
f07b137e04
commit
007fb00c0e
2 changed files with 7 additions and 1 deletions
|
@ -47,7 +47,7 @@ func GetRawDiffForFile(repoPath, startCommit, endCommit string, diffType RawDiff
|
|||
func GetRepoRawDiffForFile(repo *Repository, startCommit, endCommit string, diffType RawDiffType, file string, writer io.Writer) error {
|
||||
commit, err := repo.GetCommit(endCommit)
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetCommit: %v", err)
|
||||
return err
|
||||
}
|
||||
fileArgs := make([]string, 0)
|
||||
if len(file) > 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue