Skip to content

Commit cacfdda

Browse files
committed
Resolve lint CI failure
1 parent 22e1ee5 commit cacfdda

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

services/repository/branch.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,12 +432,10 @@ func RenameBranch(ctx context.Context, repo *repo_model.Repository, doer *user_m
432432
// If from == rule name, admins are allowed to modify them.
433433
if protectedBranch, err := git_model.GetProtectedBranchRuleByName(ctx, repo.ID, from); err != nil {
434434
return "", err
435-
} else {
436-
if protectedBranch != nil && !perm.IsAdmin() {
437-
return "", repo_model.ErrUserDoesNotHaveAccessToRepo{
438-
UserID: doer.ID,
439-
RepoName: repo.LowerName,
440-
}
435+
} else if protectedBranch != nil && !perm.IsAdmin() {
436+
return "", repo_model.ErrUserDoesNotHaveAccessToRepo{
437+
UserID: doer.ID,
438+
RepoName: repo.LowerName,
441439
}
442440
}
443441

0 commit comments

Comments
 (0)