Skip to content

Commit 01c2057

Browse files
committed
Fix lint
1 parent 59c0714 commit 01c2057

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

models/git/protected_branch.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (protectBranch *ProtectedBranch) LoadRepo(ctx context.Context) (err error)
102102
return nil
103103
}
104104
protectBranch.Repo, err = repo_model.GetRepositoryByID(ctx, protectBranch.RepoID)
105-
return
105+
return err
106106
}
107107

108108
// CanUserPush returns if some user could push to this protected branch
@@ -117,12 +117,12 @@ func (protectBranch *ProtectedBranch) CanUserPush(ctx context.Context, user *use
117117
return false
118118
}
119119

120-
if writeAccess, err := access_model.HasAccessUnit(ctx, user, protectBranch.Repo, unit.TypeCode, perm.AccessModeWrite); err != nil {
120+
writeAccess, err := access_model.HasAccessUnit(ctx, user, protectBranch.Repo, unit.TypeCode, perm.AccessModeWrite)
121+
if err != nil {
121122
log.Error("HasAccessUnit: %v", err)
122123
return false
123-
} else {
124-
return writeAccess
125124
}
125+
return writeAccess
126126
}
127127

128128
if base.Int64sContains(protectBranch.WhitelistUserIDs, user.ID) {

0 commit comments

Comments
 (0)