Skip to content

Commit

Permalink
Return 404 when tag is broken (#20017)
Browse files Browse the repository at this point in the history
Fixes #19979
  • Loading branch information
42wim authored Jun 18, 2022
1 parent 433443f commit 439ace6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/context/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 439ace6

Please sign in to comment.