Browse Source

Return 404 when tag is broken (#20017)

Fixes #19979
tags/v1.18.0-rc0
Wim 2 years ago
parent
commit
439ace607d
No account linked to committer's email address
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      modules/context/repo.go

+ 4
- 0
modules/context/repo.go View File

@@ -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
}

Loading…
Cancel
Save