diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/cmd/serv.go | 2 | ||||
-rw-r--r-- | internal/conf/computed.go | 6 | ||||
-rw-r--r-- | internal/conf/log.go | 2 | ||||
-rw-r--r-- | internal/context/repo.go | 2 | ||||
-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 | ||||
-rw-r--r-- | internal/email/message.go | 2 | ||||
-rw-r--r-- | internal/httplib/httplib.go | 2 | ||||
-rw-r--r-- | internal/route/api/v1/user/key.go | 2 | ||||
-rw-r--r-- | internal/route/repo/release.go | 2 | ||||
-rw-r--r-- | internal/route/repo/setting.go | 2 |
20 files changed, 39 insertions, 39 deletions
diff --git a/internal/cmd/serv.go b/internal/cmd/serv.go index aa7ee1bf..1f9ef044 100644 --- a/internal/cmd/serv.go +++ b/internal/cmd/serv.go @@ -230,7 +230,7 @@ func runServ(c *cli.Context) error { // Check if the key can access to the repository in case of it is a deploy key (a deploy keys != user key). // A deploy key doesn't represent a signed in user, so in a site with Auth.RequireSignInView enabled, // we should give read access only in repositories where this deploy key is in use. In other cases, - // a server or system using an active deploy key can get read access to all repositories on a Gogs instace. + // a server or system using an active deploy key can get read access to all repositories on a Gogs instance. if key.IsDeployKey() && conf.Auth.RequireSigninView { checkDeployKey(key, repo) } diff --git a/internal/conf/computed.go b/internal/conf/computed.go index 64eb322d..95acf64f 100644 --- a/internal/conf/computed.go +++ b/internal/conf/computed.go @@ -53,7 +53,7 @@ var ( workDirOnce sync.Once ) -// WorkDir returns the absolute path of work directory. It reads the value of envrionment +// WorkDir returns the absolute path of work directory. It reads the value of environment // variable GOGS_WORK_DIR. When not set, it uses the directory where the application's // binary is located. func WorkDir() string { @@ -75,8 +75,8 @@ var ( ) // CustomDir returns the absolute path of the custom directory that contains local overrides. -// It reads the value of envrionment variable GOGS_CUSTOM. When not set, it uses the work -// directory returned by WorkDir fucntion. +// It reads the value of environment variable GOGS_CUSTOM. When not set, it uses the work +// directory returned by WorkDir function. func CustomDir() string { customDirOnce.Do(func() { customDir = os.Getenv("GOGS_CUSTOM") diff --git a/internal/conf/log.go b/internal/conf/log.go index e6865a41..bde739df 100644 --- a/internal/conf/log.go +++ b/internal/conf/log.go @@ -32,7 +32,7 @@ var Log *logConf // argument "hookMode" is true, it only initializes the root path for log files. // NOTE: Because we always create a console logger as the primary logger at init time, // we need to remove it in case the user doesn't configure to use it after the logging -// service is initalized. +// service is initialized. func initLogConf(cfg *ini.File, hookMode bool) (_ *logConf, hasConsole bool, _ error) { rootPath := cfg.Section("log").Key("ROOT_PATH").MustString(filepath.Join(WorkDir(), "log")) if hookMode { diff --git a/internal/context/repo.go b/internal/context/repo.go index 7c70f0c1..01759212 100644 --- a/internal/context/repo.go +++ b/internal/context/repo.go @@ -401,7 +401,7 @@ func RepoRef() macaron.Handler { c.Data["IsViewTag"] = c.Repo.IsViewTag c.Data["IsViewCommit"] = c.Repo.IsViewCommit - // People who have push access or have fored repository can propose a new pull request. + // People who have push access or have forked repository can propose a new pull request. if c.Repo.IsWriter() || (c.IsLogged && c.User.HasForkedRepo(c.Repo.Repository.ID)) { // Pull request is allowed if this is a fork repository // and base repository accepts pull requests. 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) diff --git a/internal/email/message.go b/internal/email/message.go index 251a5d4e..cca7c6d3 100644 --- a/internal/email/message.go +++ b/internal/email/message.go @@ -219,7 +219,7 @@ var mailQueue chan *Message // NewContext initializes settings for mailer. func NewContext() { // Need to check if mailQueue is nil because in during reinstall (user had installed - // before but swithed install lock off), this function will be called again + // before but switched install lock off), this function will be called again // while mail queue is already processing tasks, and produces a race condition. if !conf.Email.Enabled || mailQueue != nil { return diff --git a/internal/httplib/httplib.go b/internal/httplib/httplib.go index 19f54ce6..1fca7fa7 100644 --- a/internal/httplib/httplib.go +++ b/internal/httplib/httplib.go @@ -431,7 +431,7 @@ func (r *Request) ToXml(v interface{}) error { return xml.Unmarshal(data, v) } -// Response executes request client gets response mannually. +// Response executes request client gets response manually. func (r *Request) Response() (*http.Response, error) { return r.getResponse() } diff --git a/internal/route/api/v1/user/key.go b/internal/route/api/v1/user/key.go index 0d8c4f16..344c7ca2 100644 --- a/internal/route/api/v1/user/key.go +++ b/internal/route/api/v1/user/key.go @@ -26,7 +26,7 @@ func GetUserByParamsName(c *context.APIContext, name string) *db.User { return user } -// GetUserByParams returns user whose name is presented in URL paramenter. +// GetUserByParams returns user whose name is presented in URL parameter. func GetUserByParams(c *context.APIContext) *db.User { return GetUserByParamsName(c, ":username") } diff --git a/internal/route/repo/release.go b/internal/route/repo/release.go index cf05b800..0aeace9a 100644 --- a/internal/route/repo/release.go +++ b/internal/route/repo/release.go @@ -63,7 +63,7 @@ func Releases(c *context.Context) { return } - // Temproray cache commits count of used branches to speed up. + // Temporary cache commits count of used branches to speed up. countCache := make(map[string]int64) results := make([]*db.Release, len(tagsPage.Tags)) diff --git a/internal/route/repo/setting.go b/internal/route/repo/setting.go index ee30225d..dcbf520c 100644 --- a/internal/route/repo/setting.go +++ b/internal/route/repo/setting.go @@ -241,7 +241,7 @@ func SettingsPost(c *context.Context, f form.RepoSetting) { } return } - log.Trace("Repository transfered: %s/%s -> %s", c.Repo.Owner.Name, repo.Name, newOwner) + log.Trace("Repository transferred: %s/%s -> %s", c.Repo.Owner.Name, repo.Name, newOwner) c.Flash.Success(c.Tr("repo.settings.transfer_succeed")) c.Redirect(conf.Server.Subpath + "/" + newOwner + "/" + repo.Name) |