Skip to content

Commit a154697

Browse files
committed
Fix lint
1 parent ac0a4ea commit a154697

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

services/pull/pull.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ func (errs errlist) Error() string {
629629
return ""
630630
}
631631

632+
var _ error = &errlist{}
633+
632634
// RetargetBranchPulls change target branch for all pull requests whose base branch is the branch
633635
// Both branch and targetBranch must be in the same repo (for security reasons)
634636
func RetargetBranchPulls(ctx context.Context, doer *user_model.User, repoID int64, branch, targetBranch string) error {
@@ -716,7 +718,10 @@ func ClosePullsCausedByBranchDeleted(ctx context.Context, doer *user_model.User,
716718
}
717719
}
718720
}
719-
return errs
721+
if len(errs) > 0 {
722+
return errs
723+
}
724+
return nil
720725
}
721726

722727
// CloseRepoBranchesPulls close all pull requests which head branches are in the given repository, but only whose base repo is not in the given repository

services/repository/push.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func pushUpdates(optsList []*repo_module.PushUpdateOptions) error {
282282
}
283283
}
284284

285-
if err = pull_service.ClosePullsCausedByBranchDeleted(ctx, pusher, repo.ID, branch); err != nil {
285+
if err := pull_service.ClosePullsCausedByBranchDeleted(ctx, pusher, repo.ID, branch); err != nil {
286286
// close all related pulls
287287
log.Error("close related pull request failed: %v", err)
288288
}

0 commit comments

Comments
 (0)