0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-06-26 23:21:46 +02:00

lint, err handle

This commit is contained in:
badhezi 2025-05-12 17:07:15 +03:00
parent f86ddd53f0
commit acb57e5031
2 changed files with 6 additions and 2 deletions

View File

@ -685,6 +685,7 @@ func CommonRoutes() *web.Router {
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md
func ContainerRoutes() *web.Router {
r := web.NewRouter()
r.Use(context.PackageContexter())
verifyAuth(r, []auth.Method{

View File

@ -235,7 +235,6 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
if strings.HasSuffix(infoPath, ".diff") {
ci.RawDiffType = git.RawDiffNormal
infoPath = strings.TrimSuffix(infoPath, ".diff")
} else if strings.HasSuffix(infoPath, ".patch") {
ci.RawDiffType = git.RawDiffPatch
infoPath = strings.TrimSuffix(infoPath, ".patch")
@ -756,7 +755,11 @@ func CompareDiff(ctx *context.Context) {
}
if ci.RawDiffType != "" {
git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
err := git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
if err != nil {
ctx.ServerError("GetRepoRawDiffForFile", err)
return
}
ctx.Resp.Flush()
return
}