]> source.dussan.org Git - gitea.git/commitdiff
Return 404 when tag is broken (#20017)
authorWim <wim@42.be>
Sat, 18 Jun 2022 17:08:34 +0000 (19:08 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Jun 2022 17:08:34 +0000 (19:08 +0200)
Fixes #19979

modules/context/repo.go

index 8e75ad07d58f24f7dd1a6d0c26ca9bda1349ca3f..217cbd3dfca33f8162ad85c1caa2a57ff64ea669 100644 (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
                                }