]> source.dussan.org Git - gitea.git/commitdiff
Fix typos in models/ (#576)
authorEthan Koenig <etk39@cornell.edu>
Thu, 5 Jan 2017 00:50:34 +0000 (19:50 -0500)
committerLunny Xiao <xiaolunwen@gmail.com>
Thu, 5 Jan 2017 00:50:34 +0000 (08:50 +0800)
15 files changed:
models/access.go
models/action.go
models/error.go
models/git_diff.go
models/graph.go
models/issue_label.go
models/issue_mail.go
models/notification.go
models/pull.go
models/repo.go
models/repo_mirror.go
models/ssh_key.go
models/user.go
models/user_mail.go
models/webhook_slack.go

index c77e7f0a168984ea421fd7b112fea952fafda941..7b139fa3cfe647c907b765db4a05e74979b4381c 100644 (file)
@@ -163,7 +163,7 @@ func maxAccessMode(modes ...AccessMode) AccessMode {
        return max
 }
 
-// FIXME: do corss-comparison so reduce deletions and additions to the minimum?
+// FIXME: do cross-comparison so reduce deletions and additions to the minimum?
 func (repo *Repository) refreshAccesses(e Engine, accessMap map[int64]AccessMode) (err error) {
        minMode := AccessModeRead
        if !repo.IsPrivate {
index f84d42d0cbde112adc4d0237813818e601f978d7..8b3d82b4d693152c570b8695aedf519ae8937c30 100644 (file)
@@ -145,7 +145,7 @@ func (a *Action) GetRepoPath() string {
 }
 
 // ShortRepoPath returns the virtual path to the action repository
-// trimed to max 20 + 1 + 33 chars.
+// trimmed to max 20 + 1 + 33 chars.
 func (a *Action) ShortRepoPath() string {
        return path.Join(a.ShortRepoUserName(), a.ShortRepoName())
 }
@@ -418,7 +418,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit) err
                        }
                }
 
-               // It is conflict to have close and reopen at same time, so refsMarkd doesn't need to reinit here.
+               // It is conflict to have close and reopen at same time, so refsMarked doesn't need to reinit here.
                for _, ref := range issueReopenKeywordsPat.FindAllString(c.Message, -1) {
                        ref = ref[strings.IndexByte(ref, byte(' '))+1:]
                        ref = strings.TrimRightFunc(ref, issueIndexTrimRight)
index f0f3bd1f76763e680a7fde8ef3d2cbfd345c15df..edbb6003e9e321227105bbff1aa5a772e7dc87dd 100644 (file)
@@ -583,7 +583,7 @@ type ErrPullRequestNotExist struct {
        IssueID    int64
        HeadRepoID int64
        BaseRepoID int64
-       HeadBarcnh string
+       HeadBranch string
        BaseBranch string
 }
 
@@ -595,7 +595,7 @@ func IsErrPullRequestNotExist(err error) bool {
 
 func (err ErrPullRequestNotExist) Error() string {
        return fmt.Sprintf("pull request does not exist [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
-               err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBarcnh, err.BaseBranch)
+               err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
 }
 
 // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
index f796f286d6d349d3dd7ab12305773c067a9bfcad..eb88d210d49b1235e4d74d15b1997810c4d9f918 100644 (file)
@@ -78,7 +78,7 @@ var (
 func diffToHTML(diffs []diffmatchpatch.Diff, lineType DiffLineType) template.HTML {
        buf := bytes.NewBuffer(nil)
 
-       // Reproduce signs which are cutted for inline diff before.
+       // Reproduce signs which are cut for inline diff before.
        switch lineType {
        case DiffLineAdd:
                buf.WriteByte('+')
@@ -234,7 +234,7 @@ const cmdDiffHead = "diff --git "
 // ParsePatch builds a Diff object from a io.Reader and some
 // parameters.
 // TODO: move this function to gogits/git-module
-func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*Diff, error) {
+func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*Diff, error) {
        var (
                diff = &Diff{Files: make([]*DiffFile, 0)}
 
@@ -295,8 +295,8 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
                curFileLinesCount++
                lineCount++
 
-               // Diff data too large, we only show the first about maxlines lines
-               if curFileLinesCount >= maxLines || len(line) >= maxLineCharacteres {
+               // Diff data too large, we only show the first about maxLines lines
+               if curFileLinesCount >= maxLines || len(line) >= maxLineCharacters {
                        curFile.IsIncomplete = true
                }
 
@@ -447,7 +447,7 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
 // GetDiffRange builds a Diff between two commits of a repository.
 // passing the empty string as beforeCommitID returns a diff from the
 // parent commit.
-func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) {
+func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) {
        gitRepo, err := git.OpenRepository(repoPath)
        if err != nil {
                return nil, err
@@ -486,7 +486,7 @@ func GetDiffRange(repoPath, beforeCommitID, afterCommitID string, maxLines, maxL
        pid := process.Add(fmt.Sprintf("GetDiffRange [repo_path: %s]", repoPath), cmd)
        defer process.Remove(pid)
 
-       diff, err := ParsePatch(maxLines, maxLineCharacteres, maxFiles, stdout)
+       diff, err := ParsePatch(maxLines, maxLineCharacters, maxFiles, stdout)
        if err != nil {
                return nil, fmt.Errorf("ParsePatch: %v", err)
        }
@@ -554,6 +554,6 @@ func GetRawDiff(repoPath, commitID string, diffType RawDiffType, writer io.Write
 }
 
 // GetDiffCommit builds a Diff representing the given commitID.
-func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacteres, maxFiles int) (*Diff, error) {
-       return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacteres, maxFiles)
+func GetDiffCommit(repoPath, commitID string, maxLines, maxLineCharacters, maxFiles int) (*Diff, error) {
+       return GetDiffRange(repoPath, "", commitID, maxLines, maxLineCharacters, maxFiles)
 }
index 973476a74632f2df4552fecc074f7c778c28b09e..7413f409de86199af547147ad62659e5468a5658 100644 (file)
@@ -31,7 +31,7 @@ type GraphItems []GraphItem
 // GetCommitGraph return a list of commit (GraphItems) from all branches
 func GetCommitGraph(r *git.Repository) (GraphItems, error) {
 
-       var Commitgraph []GraphItem
+       var CommitGraph []GraphItem
 
        format := "DATA:|%d|%H|%ad|%an|%ae|%h|%s"
 
@@ -47,19 +47,19 @@ func GetCommitGraph(r *git.Repository) (GraphItems, error) {
        )
        graph, err := graphCmd.RunInDir(r.Path)
        if err != nil {
-               return Commitgraph, err
+               return CommitGraph, err
        }
 
-       Commitgraph = make([]GraphItem, 0, 100)
+       CommitGraph = make([]GraphItem, 0, 100)
        for _, s := range strings.Split(graph, "\n") {
                GraphItem, err := graphItemFromString(s, r)
                if err != nil {
-                       return Commitgraph, err
+                       return CommitGraph, err
                }
-               Commitgraph = append(Commitgraph, GraphItem)
+               CommitGraph = append(CommitGraph, GraphItem)
        }
 
-       return Commitgraph, nil
+       return CommitGraph, nil
 }
 
 func graphItemFromString(s string, r *git.Repository) (GraphItem, error) {
@@ -102,7 +102,7 @@ func graphItemFromString(s string, r *git.Repository) (GraphItem, error) {
                rows[5],
                rows[6],
                rows[7],
-               len(rows[2]) == 0, // no commits refered to, only relation in current line.
+               len(rows[2]) == 0, // no commits referred to, only relation in current line.
        }
        return gi, nil
 }
index f06f0f97c32373975a8f6a6d13c54a8594671b94..0e1c6d6c4e752d38b1a5a6de28b926dd9d10cfa4 100644 (file)
@@ -259,7 +259,7 @@ func DeleteLabel(repoID, labelID int64) error {
 // |___/____  >____  >____/  \___  >_______ (____  /___  /\___  >____/
 //          \/     \/            \/        \/    \/    \/     \/
 
-// IssueLabel represetns an issue-lable relation.
+// IssueLabel represents an issue-label relation.
 type IssueLabel struct {
        ID      int64 `xorm:"pk autoincr"`
        IssueID int64 `xorm:"UNIQUE(s)"`
index 88adda5619838d44865aded9a293689e89542e8b..4b076606bf519c61bc4df6e75fc835179ca13aed 100644 (file)
@@ -24,7 +24,7 @@ func mailIssueCommentToParticipants(issue *Issue, doer *User, mentions []string)
                return nil
        }
 
-       // Mail wahtcers.
+       // Mail watchers.
        watchers, err := GetWatchers(issue.RepoID)
        if err != nil {
                return fmt.Errorf("GetWatchers [%d]: %v", issue.RepoID, err)
index 46d63b48238289d9cd5d71210796227063ade3f8..69f96bb5e6890bd4041607369d960faaa74bf9a8 100644 (file)
@@ -66,7 +66,7 @@ func (n *Notification) BeforeInsert() {
        n.UpdatedUnix = nowUnix
 }
 
-// BeforeUpdate runs while updateing a record
+// BeforeUpdate runs while updating a record
 func (n *Notification) BeforeUpdate() {
        var (
                now     = time.Now()
index 36194d8660b886677f5cb03c26bf6de0df44774e..6231b71cb7b685f1b8296060659d4ff8fa75ccc9 100644 (file)
@@ -372,7 +372,7 @@ func (pr *PullRequest) Merge(doer *User, baseGitRepo *git.Repository) (err error
 
        // TODO: when squash commits, no need to append merge commit.
        // 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
+       // so we need to get latest head commit and append merge commit manually
        // to avoid strange diff commits produced.
        mergeCommit, err := baseGitRepo.GetBranchCommit(pr.BaseBranch)
        if err != nil {
@@ -419,9 +419,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 !com.IsFile(patchPath) {
-               log.Trace("PullRequest[%d].testPatch: ignored cruppted data", pr.ID)
+               log.Trace("PullRequest[%d].testPatch: ignored corrupted data", pr.ID)
                return nil
        }
 
@@ -573,7 +573,7 @@ func PullRequests(baseRepoID int64, opts *PullRequestsOptions) ([]*PullRequest,
        return prs, maxResults, findSession.Find(&prs)
 }
 
-// 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)
@@ -591,7 +591,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)
@@ -602,7 +602,7 @@ func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequ
                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)
@@ -885,7 +885,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.
@@ -893,7 +893,7 @@ func (pr *PullRequest) checkAndUpdateStatus() {
                pr.Status = PullRequestStatusMergeable
        }
 
-       // 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(4, "Update[%d]: %v", pr.ID, err)
index b4f4935803005cf3784bc5931fb7ef26e867b0ff..85807e3a4b1fad1f5214d6a149019b3c036c201f 100644 (file)
@@ -259,7 +259,7 @@ func (repo *Repository) AfterSet(colName string, _ xorm.Cell) {
 
 // MustOwner always returns a valid *User object to avoid
 // conceptually impossible error handling.
-// It creates a fake object that contains error deftail
+// It creates a fake object that contains error details
 // when error occurs.
 func (repo *Repository) MustOwner() *User {
        return repo.mustOwner(x)
@@ -854,7 +854,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 {
@@ -1327,7 +1327,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)
                        }
index b834a6e5cd0e65ef8dd74762e5cb5eff1dc4a199..2cedf69d70cddb4483f977833fcbb41ff100b5d3 100644 (file)
@@ -247,7 +247,7 @@ func SyncMirrors() {
        }
 }
 
-// InitSyncMirrors initializes a go routine to sync the mirros
+// InitSyncMirrors initializes a go routine to sync the mirrors
 func InitSyncMirrors() {
        go SyncMirrors()
 }
index d7d71f68cb51af51d46f1512ab783c137284f163..cdb83b44e05332a7373b1dc78f10cb712f1cab85 100644 (file)
@@ -354,7 +354,7 @@ func appendAuthorizedKeysToFile(keys ...*PublicKey) error {
        return nil
 }
 
-// checkKeyContent onlys checks if key content has been used as public key,
+// checkKeyContent only checks if key content has been used as public key,
 // it is OK to use same key as deploy key for multiple repositories/users.
 func checkKeyContent(content string) error {
        has, err := x.Get(&PublicKey{
@@ -526,7 +526,7 @@ func DeletePublicKey(doer *User, id int64) (err error) {
 
 // RewriteAllPublicKeys 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 RewriteAllPublicKeys() error {
        sshOpLocker.Lock()
        defer sshOpLocker.Unlock()
index 9f19b1c84ed95be92c9ca78aa03cf606755fa8af..e32a29ae31250840367ce6c85cdcadf72454c5c1 100644 (file)
@@ -663,7 +663,7 @@ func Users(opts *SearchUserOptions) ([]*User, error) {
                Find(&users)
 }
 
-// get user by erify code
+// get user by verify code
 func getVerifyUser(code string) (user *User) {
        if len(code) <= base.TimeLimitCodeLength {
                return nil
@@ -1057,7 +1057,7 @@ type UserCommit struct {
        *git.Commit
 }
 
-// ValidateCommitWithEmail chceck if author's e-mail of commit is corresponsind to a user.
+// ValidateCommitWithEmail check 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 {
@@ -1216,7 +1216,7 @@ func FollowUser(userID, followID int64) (err error) {
        return sess.Commit()
 }
 
-// UnfollowUser unmarks someone be another's follower.
+// UnfollowUser unmarks someone as another's follower.
 func UnfollowUser(userID, followID int64) (err error) {
        if userID == followID || !IsFollowing(userID, followID) {
                return nil
index ce293547712a964e4b1c89e52471e2f48badaf42..4ccf08e9d9dc7c0bc5a896f2405dea4398ff4391 100644 (file)
@@ -49,8 +49,8 @@ func GetEmailAddresses(uid int64) ([]*EmailAddress, error) {
                }
        }
 
-       // We alway want the primary email address displayed, even if it's not in
-       // the emailaddress table (yet).
+       // We always want the primary email address displayed, even if it's not in
+       // the email address table (yet).
        if !isPrimaryFound {
                emails = append(emails, &EmailAddress{
                        Email:       u.Email,
index aaeef6a00153ed6c5079510ea0671d290ba6a4df..b297fefd668ac22d8c90b510abdc3b623e25aeb0 100644 (file)
@@ -16,7 +16,7 @@ import (
        "code.gitea.io/gitea/modules/setting"
 )
 
-// SlackMeta contains the slack metdata
+// SlackMeta contains the slack metadata
 type SlackMeta struct {
        Channel  string `json:"channel"`
        Username string `json:"username"`
@@ -75,7 +75,7 @@ func SlackShortTextFormatter(s string) string {
        return s
 }
 
-// SlackLinkFormatter creates a link compatablie with slack
+// SlackLinkFormatter creates a link compatible with slack
 func SlackLinkFormatter(url string, text string) string {
        return fmt.Sprintf("<%s|%s>", url, SlackTextFormatter(text))
 }