diff options
author | a1012112796 <1012112796@qq.com> | 2021-04-01 13:17:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 08:17:14 +0300 |
commit | 007fb00c0ec613b89e2a272f224b60c174fc78bd (patch) | |
tree | 6d830d6680da1a255a0c02697282e6f698b4b2dd /modules/git | |
parent | f07b137e040dc0531ce646763a5c874547d1ac7f (diff) | |
download | gitea-007fb00c0ec613b89e2a272f224b60c174fc78bd.tar.gz gitea-007fb00c0ec613b89e2a272f224b60c174fc78bd.zip |
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>
Diffstat (limited to 'modules/git')
-rw-r--r-- | modules/git/diff.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/diff.go b/modules/git/diff.go index 6faad1c3c0..5da53568e5 100644 --- a/modules/git/diff.go +++ b/modules/git/diff.go @@ -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 { |