diff options
author | Wim <wim@42.be> | 2022-06-18 19:08:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 19:08:34 +0200 |
commit | 439ace607d23e91da4b39a389730ab8a01c4eb56 (patch) | |
tree | d428c5b98454ca685f6290a461f17867963f9854 /modules/context | |
parent | 433443ffa9f41dbf548d1c63d3355221c6a63e9b (diff) | |
download | gitea-439ace607d23e91da4b39a389730ab8a01c4eb56.tar.gz gitea-439ace607d23e91da4b39a389730ab8a01c4eb56.zip |
Return 404 when tag is broken (#20017)
Fixes #19979
Diffstat (limited to 'modules/context')
-rw-r--r-- | modules/context/repo.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/repo.go b/modules/context/repo.go index 8e75ad07d5..217cbd3dfc 100644 --- a/modules/context/repo.go +++ b/modules/context/repo.go @@ -942,6 +942,10 @@ func RepoRefByType(refType RepoRefType, ignoreNotExistErr ...bool) func(*Context ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName) if err != nil { + if git.IsErrNotExist(err) { + ctx.NotFound("GetTagCommit", err) + return + } ctx.ServerError("GetTagCommit", err) return } |