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:
parent
f86ddd53f0
commit
acb57e5031
@ -685,6 +685,7 @@ func CommonRoutes() *web.Router {
|
|||||||
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md
|
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md
|
||||||
func ContainerRoutes() *web.Router {
|
func ContainerRoutes() *web.Router {
|
||||||
r := web.NewRouter()
|
r := web.NewRouter()
|
||||||
|
|
||||||
r.Use(context.PackageContexter())
|
r.Use(context.PackageContexter())
|
||||||
|
|
||||||
verifyAuth(r, []auth.Method{
|
verifyAuth(r, []auth.Method{
|
||||||
|
@ -235,7 +235,6 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
|
|||||||
if strings.HasSuffix(infoPath, ".diff") {
|
if strings.HasSuffix(infoPath, ".diff") {
|
||||||
ci.RawDiffType = git.RawDiffNormal
|
ci.RawDiffType = git.RawDiffNormal
|
||||||
infoPath = strings.TrimSuffix(infoPath, ".diff")
|
infoPath = strings.TrimSuffix(infoPath, ".diff")
|
||||||
|
|
||||||
} else if strings.HasSuffix(infoPath, ".patch") {
|
} else if strings.HasSuffix(infoPath, ".patch") {
|
||||||
ci.RawDiffType = git.RawDiffPatch
|
ci.RawDiffType = git.RawDiffPatch
|
||||||
infoPath = strings.TrimSuffix(infoPath, ".patch")
|
infoPath = strings.TrimSuffix(infoPath, ".patch")
|
||||||
@ -756,7 +755,11 @@ func CompareDiff(ctx *context.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ci.RawDiffType != "" {
|
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()
|
ctx.Resp.Flush()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user