summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/branches.go2
-rw-r--r--models/context.go2
-rw-r--r--models/error.go4
-rw-r--r--models/gpg_key.go4
-rw-r--r--models/issue_comment.go6
-rw-r--r--models/issue_dependency.go2
-rw-r--r--models/issue_label_test.go2
-rw-r--r--models/login_source.go2
-rw-r--r--models/migrations/migrations.go2
-rw-r--r--models/migrations/v111.go4
-rw-r--r--models/migrations/v147.go2
-rw-r--r--models/oauth2_application.go6
-rw-r--r--models/org.go2
-rw-r--r--models/repo.go2
-rw-r--r--models/repo_list.go4
-rw-r--r--models/repo_permission.go4
-rw-r--r--models/repo_pushmirror.go2
-rw-r--r--models/review.go4
-rw-r--r--models/topic.go2
-rw-r--r--models/user.go4
-rw-r--r--models/user_mail.go2
21 files changed, 32 insertions, 32 deletions
diff --git a/models/branches.go b/models/branches.go
index d346f19578..e13d84ee05 100644
--- a/models/branches.go
+++ b/models/branches.go
@@ -219,7 +219,7 @@ func (protectBranch *ProtectedBranch) GetProtectedFilePatterns() []glob.Glob {
expr = strings.TrimSpace(expr)
if expr != "" {
if g, err := glob.Compile(expr, '.', '/'); err != nil {
- log.Info("Invalid glob expresion '%s' (skipped): %v", expr, err)
+ log.Info("Invalid glob expression '%s' (skipped): %v", expr, err)
} else {
extarr = append(extarr, g)
}
diff --git a/models/context.go b/models/context.go
index 4fbd3b6699..1221ab7ded 100644
--- a/models/context.go
+++ b/models/context.go
@@ -42,7 +42,7 @@ func WithContext(f func(ctx DBContext) error) error {
return f(DBContext{x})
}
-// WithTx represents executing database operations on a trasaction
+// WithTx represents executing database operations on a transaction
func WithTx(f func(ctx DBContext) error) error {
sess := x.NewSession()
if err := sess.Begin(); err != nil {
diff --git a/models/error.go b/models/error.go
index 513effdb02..7b99dc6592 100644
--- a/models/error.go
+++ b/models/error.go
@@ -1114,7 +1114,7 @@ func IsErrUserDoesNotHaveAccessToRepo(err error) bool {
}
func (err ErrUserDoesNotHaveAccessToRepo) Error() string {
- return fmt.Sprintf("user doesn't have acces to repo [user_id: %d, repo_name: %s]", err.UserID, err.RepoName)
+ return fmt.Sprintf("user doesn't have access to repo [user_id: %d, repo_name: %s]", err.UserID, err.RepoName)
}
// ErrWontSign explains the first reason why a commit would not be signed
@@ -1289,7 +1289,7 @@ func IsErrSHAOrCommitIDNotProvided(err error) bool {
}
func (err ErrSHAOrCommitIDNotProvided) Error() string {
- return "a SHA or commmit ID must be proved when updating a file"
+ return "a SHA or commit ID must be proved when updating a file"
}
// __ __ ___. .__ __
diff --git a/models/gpg_key.go b/models/gpg_key.go
index 9530eacb0a..140a71df6d 100644
--- a/models/gpg_key.go
+++ b/models/gpg_key.go
@@ -622,7 +622,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
var err error
// Find Committer account
committer, err = GetUserByEmail(c.Committer.Email) // This finds the user by primary email or activated email so commit will not be valid if email is not
- if err != nil { // Skipping not user for commiter
+ if err != nil { // Skipping not user for committer
committer = &User{
Name: c.Committer.Name,
Email: c.Committer.Email,
@@ -698,7 +698,7 @@ func ParseCommitWithSignature(c *git.Commit) *CommitVerification {
}
for _, k := range keys {
- // Pre-check (& optimization) that emails attached to key can be attached to the commiter email and can validate
+ // Pre-check (& optimization) that emails attached to key can be attached to the committer email and can validate
canValidate := false
email := ""
for _, e := range k.Emails {
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 1b98b248b1..4c5b77ff8e 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -184,7 +184,7 @@ type Comment struct {
RefRepoID int64 `xorm:"index"` // Repo where the referencing
RefIssueID int64 `xorm:"index"`
RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's)
- RefAction references.XRefAction `xorm:"SMALLINT"` // What hapens if RefIssueID resolves
+ RefAction references.XRefAction `xorm:"SMALLINT"` // What happens if RefIssueID resolves
RefIsPull bool
RefRepo *Repository `xorm:"-"`
@@ -1228,7 +1228,7 @@ func UpdateCommentsMigrationsByType(tp structs.GitServiceType, originalAuthorID
return err
}
-// CreatePushPullComment create push code to pull base commend
+// CreatePushPullComment create push code to pull base comment
func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommitID string) (comment *Comment, err error) {
if pr.HasMerged || oldCommitID == "" || newCommitID == "" {
return nil, nil
@@ -1262,7 +1262,7 @@ func CreatePushPullComment(pusher *User, pr *PullRequest, oldCommitID, newCommit
return
}
-// getCommitsFromRepo get commit IDs from repo in betwern oldCommitID and newCommitID
+// getCommitsFromRepo get commit IDs from repo in between oldCommitID and newCommitID
// isForcePush will be true if oldCommit isn't on the branch
// Commit on baseBranch will skip
func getCommitIDsFromRepo(repo *Repository, oldCommitID, newCommitID, baseBranch string) (commitIDs []string, isForcePush bool, err error) {
diff --git a/models/issue_dependency.go b/models/issue_dependency.go
index 6ecaf3432f..4008008f34 100644
--- a/models/issue_dependency.go
+++ b/models/issue_dependency.go
@@ -128,7 +128,7 @@ func issueNoDependenciesLeft(e Engine, issue *Issue) (bool, error) {
return !exists, err
}
-// IsDependenciesEnabled returns if dependecies are enabled and returns the default setting if not set.
+// IsDependenciesEnabled returns if dependencies are enabled and returns the default setting if not set.
func (repo *Repository) IsDependenciesEnabled() bool {
return repo.isDependenciesEnabled(x)
}
diff --git a/models/issue_label_test.go b/models/issue_label_test.go
index fc6590e968..3dde1a4069 100644
--- a/models/issue_label_test.go
+++ b/models/issue_label_test.go
@@ -135,7 +135,7 @@ func TestGetLabelsByRepoID(t *testing.T) {
testSuccess(1, "default", []int64{1, 2})
}
-// Org vrsions
+// Org versions
func TestGetLabelInOrgByName(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
diff --git a/models/login_source.go b/models/login_source.go
index 7ff7e994ea..f9bd496b3a 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -343,7 +343,7 @@ func CreateLoginSource(source *LoginSource) error {
} else if has {
return ErrLoginSourceAlreadyExist{source.Name}
}
- // Synchronization is only aviable with LDAP for now
+ // Synchronization is only available with LDAP for now
if !source.IsLDAP() {
source.IsSyncEnabled = false
}
diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go
index 0e8b0d0e3d..de60d89bbe 100644
--- a/models/migrations/migrations.go
+++ b/models/migrations/migrations.go
@@ -187,7 +187,7 @@ var migrations = []Migration{
// v122 -> v123
NewMigration("Add Require Signed Commits to ProtectedBranch", addRequireSignedCommits),
// v123 -> v124
- NewMigration("Add original informations for reactions", addReactionOriginals),
+ NewMigration("Add original information for reactions", addReactionOriginals),
// v124 -> v125
NewMigration("Add columns to user and repository", addUserRepoMissingColumns),
// v125 -> v126
diff --git a/models/migrations/v111.go b/models/migrations/v111.go
index b292f0c7d3..95f0ec22dd 100644
--- a/models/migrations/v111.go
+++ b/models/migrations/v111.go
@@ -141,8 +141,8 @@ func addBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error {
return perm, err
}
- // Prevent strangers from checking out public repo of private orginization
- // Allow user if they are collaborator of a repo within a private orginization but not a member of the orginization itself
+ // Prevent strangers from checking out public repo of private organization
+ // Allow user if they are collaborator of a repo within a private organization but not a member of the organization itself
hasOrgVisible := true
// Not SignedUser
if user == nil {
diff --git a/models/migrations/v147.go b/models/migrations/v147.go
index 7488b370aa..ad4ec4ef7f 100644
--- a/models/migrations/v147.go
+++ b/models/migrations/v147.go
@@ -75,7 +75,7 @@ func createReviewsForCodeComments(x *xorm.Engine) error {
RefRepoID int64 `xorm:"index"` // Repo where the referencing
RefIssueID int64 `xorm:"index"`
RefCommentID int64 `xorm:"index"` // 0 if origin is Issue title or content (or PR's)
- RefAction int `xorm:"SMALLINT"` // What hapens if RefIssueID resolves
+ RefAction int `xorm:"SMALLINT"` // What happens if RefIssueID resolves
RefIsPull bool
}
diff --git a/models/oauth2_application.go b/models/oauth2_application.go
index 3509dba54e..5a924763be 100644
--- a/models/oauth2_application.go
+++ b/models/oauth2_application.go
@@ -210,7 +210,7 @@ func UpdateOAuth2Application(opts UpdateOAuth2ApplicationOptions) (*OAuth2Applic
return nil, err
}
if app.UID != opts.UserID {
- return nil, fmt.Errorf("UID missmatch")
+ return nil, fmt.Errorf("UID mismatch")
}
app.Name = opts.Name
@@ -376,7 +376,7 @@ func getOAuth2AuthorizationByCode(e Engine, code string) (auth *OAuth2Authorizat
//////////////////////////////////////////////////////
-// OAuth2Grant represents the permission of an user for a specifc application to access resources
+// OAuth2Grant represents the permission of an user for a specific application to access resources
type OAuth2Grant struct {
ID int64 `xorm:"pk autoincr"`
UserID int64 `xorm:"INDEX unique(user_application)"`
@@ -537,7 +537,7 @@ type OAuth2Token struct {
jwt.StandardClaims
}
-// ParseOAuth2Token parses a singed jwt string
+// ParseOAuth2Token parses a signed jwt string
func ParseOAuth2Token(jwtToken string) (*OAuth2Token, error) {
parsedToken, err := jwt.ParseWithClaims(jwtToken, &OAuth2Token{}, func(token *jwt.Token) (interface{}, error) {
if token.Method == nil || token.Method.Alg() != oauth2.DefaultSigningKey.SigningMethod().Alg() {
diff --git a/models/org.go b/models/org.go
index 073b26c2f8..58fb26b1bb 100644
--- a/models/org.go
+++ b/models/org.go
@@ -79,7 +79,7 @@ func (org *User) GetMembers() (err error) {
return
}
-// FindOrgMembersOpts represensts find org members condtions
+// FindOrgMembersOpts represensts find org members conditions
type FindOrgMembersOpts struct {
ListOptions
OrgID int64
diff --git a/models/repo.go b/models/repo.go
index 009e7a457d..e158dc12dd 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -1616,7 +1616,7 @@ func DeleteRepository(doer *User, uid, repoID int64) error {
sess.Close()
// We should always delete the files after the database transaction succeed. If
- // we delete the file but the database rollback, the repository will be borken.
+ // we delete the file but the database rollback, the repository will be broken.
// Remove issue attachment files.
for i := range attachmentPaths {
diff --git a/models/repo_list.go b/models/repo_list.go
index b4a6d9e438..b988ceffac 100644
--- a/models/repo_list.go
+++ b/models/repo_list.go
@@ -148,11 +148,11 @@ type SearchRepoOptions struct {
AllLimited bool // Include also all public repositories of limited organisations
// None -> include public and private
// True -> include just private
- // False -> incude just public
+ // False -> include just public
IsPrivate util.OptionalBool
// None -> include collaborative AND non-collaborative
// True -> include just collaborative
- // False -> incude just non-collaborative
+ // False -> include just non-collaborative
Collaborate util.OptionalBool
// None -> include forks AND non-forks
// True -> include just forks
diff --git a/models/repo_permission.go b/models/repo_permission.go
index 4f043a58cc..f5138fc54c 100644
--- a/models/repo_permission.go
+++ b/models/repo_permission.go
@@ -176,7 +176,7 @@ func getUserRepoPermission(e Engine, repo *Repository, user *User) (perm Permiss
return
}
- // Prevent strangers from checking out public repo of private orginization/users
+ // Prevent strangers from checking out public repo of private organization/users
// Allow user if they are collaborator of a repo within a private user or a private organization but not a member of the organization itself
if !hasOrgOrUserVisible(e, repo.Owner, user) && !isCollaborator {
perm.AccessMode = AccessModeNone
@@ -351,7 +351,7 @@ func hasAccessUnit(e Engine, user *User, repo *Repository, unitType UnitType, te
return testMode <= mode, err
}
-// HasAccessUnit returns ture if user has testMode to the unit of the repository
+// HasAccessUnit returns true if user has testMode to the unit of the repository
func HasAccessUnit(user *User, repo *Repository, unitType UnitType, testMode AccessMode) (bool, error) {
return hasAccessUnit(x, user, repo, unitType, testMode)
}
diff --git a/models/repo_pushmirror.go b/models/repo_pushmirror.go
index bdd4198f92..439972ffa6 100644
--- a/models/repo_pushmirror.go
+++ b/models/repo_pushmirror.go
@@ -91,7 +91,7 @@ func GetPushMirrorByID(ID int64) (*PushMirror, error) {
return m, nil
}
-// GetPushMirrorsByRepoID returns push-mirror informations of a repository.
+// GetPushMirrorsByRepoID returns push-mirror information of a repository.
func GetPushMirrorsByRepoID(repoID int64) ([]*PushMirror, error) {
mirrors := make([]*PushMirror, 0, 10)
return mirrors, x.Where("repo_id=?", repoID).Find(&mirrors)
diff --git a/models/review.go b/models/review.go
index 316cbe4da6..acb54d970f 100644
--- a/models/review.go
+++ b/models/review.go
@@ -466,7 +466,7 @@ func GetReviewersByIssueID(issueID int64) ([]*Review, error) {
return nil, err
}
- // Get latest review of each reviwer, sorted in order they were made
+ // Get latest review of each reviewer, sorted in order they were made
if err := sess.SQL("SELECT * FROM review WHERE id IN (SELECT max(id) as id FROM review WHERE issue_id = ? AND reviewer_team_id = 0 AND type in (?, ?, ?) AND dismissed = ? AND original_author_id = 0 GROUP BY issue_id, reviewer_id) ORDER BY review.updated_unix ASC",
issueID, ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest, false).
Find(&reviews); err != nil {
@@ -491,7 +491,7 @@ func GetReviewersByIssueID(issueID int64) ([]*Review, error) {
func GetReviewersFromOriginalAuthorsByIssueID(issueID int64) ([]*Review, error) {
reviews := make([]*Review, 0, 10)
- // Get latest review of each reviwer, sorted in order they were made
+ // Get latest review of each reviewer, sorted in order they were made
if err := x.SQL("SELECT * FROM review WHERE id IN (SELECT max(id) as id FROM review WHERE issue_id = ? AND reviewer_team_id = 0 AND type in (?, ?, ?) AND original_author_id <> 0 GROUP BY issue_id, original_author_id) ORDER BY review.updated_unix ASC",
issueID, ReviewTypeApprove, ReviewTypeReject, ReviewTypeRequest).
Find(&reviews); err != nil {
diff --git a/models/topic.go b/models/topic.go
index 31e81c8d0f..19c572fefe 100644
--- a/models/topic.go
+++ b/models/topic.go
@@ -195,7 +195,7 @@ func FindTopics(opts *FindTopicOptions) (topics []*Topic, err error) {
return topics, sess.Desc("topic.repo_count").Find(&topics)
}
-// GetRepoTopicByName retrives topic from name for a repo if it exist
+// GetRepoTopicByName retrieves topic from name for a repo if it exist
func GetRepoTopicByName(repoID int64, topicName string) (*Topic, error) {
return getRepoTopicByName(x, repoID, topicName)
}
diff --git a/models/user.go b/models/user.go
index ce96a144af..3b8ce79251 100644
--- a/models/user.go
+++ b/models/user.go
@@ -1631,7 +1631,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
// If Admin - they see all users!
if !opts.Actor.IsAdmin {
- // Force visiblity for privacy
+ // Force visibility for privacy
var accessCond builder.Cond
if !opts.Actor.IsRestricted {
accessCond = builder.Or(
@@ -1647,7 +1647,7 @@ func (opts *SearchUserOptions) toConds() builder.Cond {
}
} else {
- // Force visiblity for privacy
+ // Force visibility for privacy
// Not logged in - only public users
cond = cond.And(builder.In("visibility", structs.VisibleTypePublic))
}
diff --git a/models/user_mail.go b/models/user_mail.go
index 320f2cb05a..89cbdf12a4 100644
--- a/models/user_mail.go
+++ b/models/user_mail.go
@@ -269,7 +269,7 @@ func MakeEmailPrimary(email *EmailAddress) error {
return err
}
- // 3. update new primay email
+ // 3. update new primary email
email.IsPrimary = true
if _, err = sess.ID(email.ID).Cols("is_primary").Update(email); err != nil {
return err