Skip to content

Commit 5511709

Browse files
committed
lint, err handle
1 parent ed52100 commit 5511709

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
@@ -685,6 +685,7 @@ func CommonRoutes() *web.Router {
685685
// https://github.com/opencontainers/distribution-spec/blob/main/spec.md
686686
func ContainerRoutes() *web.Router {
687687
r := web.NewRouter()
688+
688689
r.Use(context.PackageContexter())
689690

690691
verifyAuth(r, []auth.Method{

routers/web/repo/compare.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
235235
if strings.HasSuffix(infoPath, ".diff") {
236236
ci.RawDiffType = git.RawDiffNormal
237237
infoPath = strings.TrimSuffix(infoPath, ".diff")
238-
239238
} else if strings.HasSuffix(infoPath, ".patch") {
240239
ci.RawDiffType = git.RawDiffPatch
241240
infoPath = strings.TrimSuffix(infoPath, ".patch")
@@ -756,7 +755,11 @@ func CompareDiff(ctx *context.Context) {
756755
}
757756

758757
if ci.RawDiffType != "" {
759-
git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
758+
err := git.GetRepoRawDiffForFile(ci.HeadGitRepo, ci.BaseBranch, ci.HeadBranch, ci.RawDiffType, "", ctx.Resp)
759+
if err != nil {
760+
ctx.ServerError("GetRepoRawDiffForFile", err)
761+
return
762+
}
760763
ctx.Resp.Flush()
761764
return
762765
}

0 commit comments

Comments
 (0)