From ba37b9e5779eb0c7834b9bc76ac213e7d931011d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 28 May 2024 17:31:59 +0800 Subject: [PATCH] Add missed return after `ctx.ServerError` (#31130) (partial) Only routers/api/v1/repo/mirror.go (cherry picked from commit b6f15c7948ac3d09977350de83ec91d5789ea083) --- routers/api/v1/repo/mirror.go | 1 + 1 file changed, 1 insertion(+) diff --git a/routers/api/v1/repo/mirror.go b/routers/api/v1/repo/mirror.go index 2a896de4fe..eddd449206 100644 --- a/routers/api/v1/repo/mirror.go +++ b/routers/api/v1/repo/mirror.go @@ -383,6 +383,7 @@ func CreatePushMirror(ctx *context.APIContext, mirrorOption *api.CreatePushMirro if err = mirror_service.AddPushMirrorRemote(ctx, pushMirror, address); err != nil { if err := repo_model.DeletePushMirrors(ctx, repo_model.PushMirrorOptions{ID: pushMirror.ID, RepoID: pushMirror.RepoID}); err != nil { ctx.ServerError("DeletePushMirrors", err) + return } ctx.ServerError("AddPushMirrorRemote", err) return