diff options
Diffstat (limited to 'internal/db')
-rw-r--r-- | internal/db/issue_label.go | 2 | ||||
-rw-r--r-- | internal/db/mirror.go | 2 | ||||
-rw-r--r-- | internal/db/org.go | 4 | ||||
-rw-r--r-- | internal/db/pull.go | 22 | ||||
-rw-r--r-- | internal/db/release.go | 2 | ||||
-rw-r--r-- | internal/db/repo.go | 8 | ||||
-rw-r--r-- | internal/db/repo_branch.go | 4 | ||||
-rw-r--r-- | internal/db/ssh_key.go | 2 | ||||
-rw-r--r-- | internal/db/user.go | 6 | ||||
-rw-r--r-- | internal/db/user_mail.go | 2 | ||||
-rw-r--r-- | internal/db/webhook.go | 2 |
11 files changed, 28 insertions, 28 deletions
diff --git a/internal/db/issue_label.go b/internal/db/issue_label.go index 0eaa9b96..46e8a62c 100644 --- a/internal/db/issue_label.go +++ b/internal/db/issue_label.go @@ -257,7 +257,7 @@ func DeleteLabel(repoID, labelID int64) error { // |___/____ >____ >____/ \___ >_______ (____ /___ /\___ >____/ // \/ \/ \/ \/ \/ \/ \/ -// IssueLabel represetns an issue-lable relation. +// IssueLabel represents an issue-lable relation. type IssueLabel struct { ID int64 IssueID int64 `xorm:"UNIQUE(s)"` diff --git a/internal/db/mirror.go b/internal/db/mirror.go index 4ee3ce8e..4313d736 100644 --- a/internal/db/mirror.go +++ b/internal/db/mirror.go @@ -66,7 +66,7 @@ func (m *Mirror) AfterSet(colName string, _ xorm.Cell) { } } -// ScheduleNextSync calculates and sets next sync time based on repostiroy mirror setting. +// ScheduleNextSync calculates and sets next sync time based on repository mirror setting. func (m *Mirror) ScheduleNextSync() { m.NextSync = time.Now().Add(time.Duration(m.Interval) * time.Hour) } diff --git a/internal/db/org.go b/internal/db/org.go index 0c257163..88ad0236 100644 --- a/internal/db/org.go +++ b/internal/db/org.go @@ -58,7 +58,7 @@ func (org *User) GetTeams() error { return org.getTeams(x) } -// TeamsHaveAccessToRepo returns all teamsthat have given access level to the repository. +// TeamsHaveAccessToRepo returns all teams that have given access level to the repository. func (org *User) TeamsHaveAccessToRepo(repoID int64, mode AccessMode) ([]*Team, error) { return GetTeamsHaveAccessToRepo(org.ID, repoID, mode) } @@ -470,7 +470,7 @@ func (org *User) getUserTeams(e Engine, userID int64, cols ...string) ([]*Team, Cols(cols...).Find(&teams) } -// GetUserTeamIDs returns of all team IDs of the organization that user is memeber of. +// GetUserTeamIDs returns of all team IDs of the organization that user is member of. func (org *User) GetUserTeamIDs(userID int64) ([]int64, error) { teams, err := org.getUserTeams(x, userID, "team.id") if err != nil { diff --git a/internal/db/pull.go b/internal/db/pull.go index b1046715..d226f2d8 100644 --- a/internal/db/pull.go +++ b/internal/db/pull.go @@ -362,7 +362,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle // NOTE: It is possible that head branch is not fully sync with base branch // for merge commits, so we need to get latest head commit and append merge - // commit manully to avoid strange diff commits produced. + // commit manually to avoid strange diff commits produced. mergeCommit, err := baseGitRepo.BranchCommit(pr.BaseBranch) if err != nil { log.Error("Failed to get base branch %q commit: %v", pr.BaseBranch, err) @@ -395,7 +395,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository, mergeStyle return nil } -// testPatch checks if patch can be merged to base repository without conflit. +// testPatch checks if patch can be merged to base repository without conflict. // FIXME: make a mechanism to clean up stable local copies. func (pr *PullRequest) testPatch() (err error) { if pr.BaseRepo == nil { @@ -410,9 +410,9 @@ func (pr *PullRequest) testPatch() (err error) { return fmt.Errorf("BaseRepo.PatchPath: %v", err) } - // Fast fail if patch does not exist, this assumes data is cruppted. + // Fast fail if patch does not exist, this assumes data is corrupted. if !osutil.IsFile(patchPath) { - log.Trace("PullRequest[%d].testPatch: ignored cruppted data", pr.ID) + log.Trace("PullRequest[%d].testPatch: ignored corrupted data", pr.ID) return nil } @@ -436,7 +436,7 @@ func (pr *PullRequest) testPatch() (err error) { fmt.Sprintf("testPatch (git apply --check): %d", pr.BaseRepo.ID), "git", args...) if err != nil { - log.Trace("PullRequest[%d].testPatch (apply): has conflit\n%s", pr.ID, stderr) + log.Trace("PullRequest[%d].testPatch (apply): has conflict\n%s", pr.ID, stderr) pr.Status = PULL_REQUEST_STATUS_CONFLICT return nil } @@ -515,7 +515,7 @@ func NewPullRequest(repo *Repository, pull *Issue, labelIDs []int64, uuids []str return nil } -// GetUnmergedPullRequest returnss a pull request that is open and has not been merged +// GetUnmergedPullRequest returns a pull request that is open and has not been merged // by given head/base and repo/branch. func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch string) (*PullRequest, error) { pr := new(PullRequest) @@ -536,7 +536,7 @@ func GetUnmergedPullRequest(headRepoID, baseRepoID int64, headBranch, baseBranch return pr, nil } -// GetUnmergedPullRequestsByHeadInfo returnss all pull requests that are open and has not been merged +// GetUnmergedPullRequestsByHeadInfo returns all pull requests that are open and has not been merged // by given head information (repo and branch). func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequest, error) { prs := make([]*PullRequest, 0, 2) @@ -545,7 +545,7 @@ func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequ Join("INNER", "issue", "issue.id = pull_request.issue_id").Find(&prs) } -// GetUnmergedPullRequestsByBaseInfo returnss all pull requests that are open and has not been merged +// GetUnmergedPullRequestsByBaseInfo returns all pull requests that are open and has not been merged // by given base information (repo and branch). func GetUnmergedPullRequestsByBaseInfo(repoID int64, branch string) ([]*PullRequest, error) { prs := make([]*PullRequest, 0, 2) @@ -622,7 +622,7 @@ func (pr *PullRequest) UpdateCols(cols ...string) error { // UpdatePatch generates and saves a new patch. func (pr *PullRequest) UpdatePatch() (err error) { if pr.HeadRepo == nil { - log.Trace("PullRequest[%d].UpdatePatch: ignored cruppted data", pr.ID) + log.Trace("PullRequest[%d].UpdatePatch: ignored corrupted data", pr.ID) return nil } @@ -829,7 +829,7 @@ func ChangeUsernameInPullRequests(oldUserName, newUserName string) error { return err } -// checkAndUpdateStatus checks if pull request is possible to levaing checking status, +// checkAndUpdateStatus checks if pull request is possible to leaving checking status, // and set to be either conflict or mergeable. func (pr *PullRequest) checkAndUpdateStatus() { // Status is not changed to conflict means mergeable. @@ -837,7 +837,7 @@ func (pr *PullRequest) checkAndUpdateStatus() { pr.Status = PULL_REQUEST_STATUS_MERGEABLE } - // Make sure there is no waiting test to process before levaing the checking status. + // Make sure there is no waiting test to process before leaving the checking status. if !PullRequestQueue.Exist(pr.ID) { if err := pr.UpdateCols("status"); err != nil { log.Error("Update[%d]: %v", pr.ID, err) diff --git a/internal/db/release.go b/internal/db/release.go index 7ec558b8..e38dc8b1 100644 --- a/internal/db/release.go +++ b/internal/db/release.go @@ -352,7 +352,7 @@ func DeleteReleaseOfRepoByID(repoID, id int64) error { return fmt.Errorf("GetReleaseByID: %v", err) } - // Mark sure the delete operation againsts same repository. + // Mark sure the delete operation against same repository. if repoID != rel.RepoID { return nil } diff --git a/internal/db/repo.go b/internal/db/repo.go index a2d23a63..1165912b 100644 --- a/internal/db/repo.go +++ b/internal/db/repo.go @@ -278,7 +278,7 @@ func (repo *Repository) CanGuestViewIssues() bool { } // MustOwner always returns a valid *User object to avoid conceptually impossible error handling. -// It creates a fake object that contains error deftail when error occurs. +// It creates a fake object that contains error details when error occurs. func (repo *Repository) MustOwner() *User { return repo.mustOwner(x) } @@ -951,7 +951,7 @@ func getRepoInitFile(tp, name string) ([]byte, error) { } func prepareRepoCommit(repo *Repository, tmpDir, repoPath string, opts CreateRepoOptions) error { - // Clone to temprory path and do the init commit. + // Clone to temporary path and do the init commit. _, stderr, err := process.Exec( fmt.Sprintf("initRepository(git clone): %s", repoPath), "git", "clone", repoPath, tmpDir) if err != nil { @@ -1233,7 +1233,7 @@ func RepositoriesWithUsers(page, pageSize int) (_ []*Repository, err error) { return repos, nil } -// FilterRepositoryWithIssues selects repositories that are using interal issue tracker +// FilterRepositoryWithIssues selects repositories that are using internal issue tracker // and has disabled external tracker from given set. // It returns nil if result set is empty. func FilterRepositoryWithIssues(repoIDs []int64) ([]int64, error) { @@ -1468,7 +1468,7 @@ func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err e return fmt.Errorf("getOwner: %v", err) } if repo.Owner.IsOrganization() { - // Organization repository need to recalculate access table when visivility is changed + // Organization repository need to recalculate access table when visibility is changed if err = repo.recalculateTeamAccesses(e, 0); err != nil { return fmt.Errorf("recalculateTeamAccesses: %v", err) } diff --git a/internal/db/repo_branch.go b/internal/db/repo_branch.go index 3b7f9137..22c15b69 100644 --- a/internal/db/repo_branch.go +++ b/internal/db/repo_branch.go @@ -111,7 +111,7 @@ type ProtectBranch struct { WhitelistTeamIDs string `xorm:"TEXT"` } -// GetProtectBranchOfRepoByName returns *ProtectBranch by branch name in given repostiory. +// GetProtectBranchOfRepoByName returns *ProtectBranch by branch name in given repository. func GetProtectBranchOfRepoByName(repoID int64, name string) (*ProtectBranch, error) { protectBranch := &ProtectBranch{ RepoID: repoID, @@ -271,7 +271,7 @@ func UpdateOrgProtectBranch(repo *Repository, protectBranch *ProtectBranch, whit return sess.Commit() } -// GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repostiory. +// GetProtectBranchesByRepoID returns a list of *ProtectBranch in given repository. func GetProtectBranchesByRepoID(repoID int64) ([]*ProtectBranch, error) { protectBranches := make([]*ProtectBranch, 0, 2) return protectBranches, x.Where("repo_id = ? and protected = ?", repoID, true).Asc("name").Find(&protectBranches) diff --git a/internal/db/ssh_key.go b/internal/db/ssh_key.go index 37bf9ae1..379c5b1d 100644 --- a/internal/db/ssh_key.go +++ b/internal/db/ssh_key.go @@ -517,7 +517,7 @@ func DeletePublicKey(doer *User, id int64) (err error) { // RewriteAuthorizedKeys removes any authorized key and rewrite all keys from database again. // Note: x.Iterate does not get latest data after insert/delete, so we have to call this function -// outsite any session scope independently. +// outside any session scope independently. func RewriteAuthorizedKeys() error { sshOpLocker.Lock() defer sshOpLocker.Unlock() diff --git a/internal/db/user.go b/internal/db/user.go index 0e3c106e..3ebaabff 100644 --- a/internal/db/user.go +++ b/internal/db/user.go @@ -283,7 +283,7 @@ func (u *User) AvatarLink() string { return link } -// User.GetFollwoers returns range of user's followers. +// User.GetFollowers returns range of user's followers. func (u *User) GetFollowers(page int) ([]*User, error) { users := make([]*User, 0, ItemsPerPage) sess := x.Limit(ItemsPerPage, (page-1)*ItemsPerPage).Where("follow.follow_id=?", u.ID) @@ -468,7 +468,7 @@ func (u *User) ShortName(length int) string { return tool.EllipsisString(u.Name, length) } -// IsMailable checks if a user is elegible +// IsMailable checks if a user is eligible // to receive emails. func (u *User) IsMailable() bool { return u.IsActive @@ -1002,7 +1002,7 @@ type UserCommit struct { *git.Commit } -// ValidateCommitWithEmail chceck if author's e-mail of commit is corresponsind to a user. +// ValidateCommitWithEmail checks if author's e-mail of commit is corresponding to a user. func ValidateCommitWithEmail(c *git.Commit) *User { u, err := GetUserByEmail(c.Author.Email) if err != nil { diff --git a/internal/db/user_mail.go b/internal/db/user_mail.go index f73278b6..990b4aa1 100644 --- a/internal/db/user_mail.go +++ b/internal/db/user_mail.go @@ -44,7 +44,7 @@ func GetEmailAddresses(uid int64) ([]*EmailAddress, error) { } } - // We alway want the primary email address displayed, even if it's not in + // We always want the primary email address displayed, even if it's not in // the emailaddress table (yet). if !isPrimaryFound { emails = append(emails, &EmailAddress{ diff --git a/internal/db/webhook.go b/internal/db/webhook.go index 080b73fd..61602ef9 100644 --- a/internal/db/webhook.go +++ b/internal/db/webhook.go @@ -601,7 +601,7 @@ func prepareHookTasks(e Engine, repo *Repository, event HookEventType, p api.Pay } } - // Use separate objects so modifcations won't be made on payload on non-Gogs type hooks. + // Use separate objects so modifications won't be made on payload on non-Gogs type hooks. switch w.HookTaskType { case SLACK: payloader, err = GetSlackPayload(p, event, w.Meta) |