Skip to content

Commit f3f4f6d

Browse files
committed
lint, err handle
1 parent 86c2371 commit f3f4f6d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

routers/api/packages/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@ func CommonRoutes() *web.Router {
532532
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md
533533
func ContainerRoutes() *web.Router {
534534
r := web.NewRouter()
535+
535536
r.Use(context.PackageContexter())
536537

537538
verifyAuth(r, []auth.Method{

routers/web/repo/compare.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
237237
if strings.HasSuffix(infoPath, ".diff") {
238238
ci.RawDiffType = git.RawDiffNormal
239239
infoPath = strings.TrimSuffix(infoPath, ".diff")
240-
241240
} else if strings.HasSuffix(infoPath, ".patch") {
242241
ci.RawDiffType = git.RawDiffPatch
243242
infoPath = strings.TrimSuffix(infoPath, ".patch")
@@ -759,7 +758,11 @@ func CompareDiff(ctx *context.Context) {
759758
}
760759

761760
if ci.RawDiffType != "" {
762-
git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
761+
err := git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
762+
if err != nil {
763+
ctx.ServerError("GetRepoRawDiffForFile", err)
764+
return
765+
}
763766
ctx.Resp.Flush()
764767
return
765768
}

0 commit comments

Comments
 (0)