Skip to content

Commit

Permalink
Correct committer spelling and fix wrong replaced words
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Sep 18, 2021
1 parent 153793b commit dbd002d
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 60 deletions.
6 changes: 3 additions & 3 deletions models/commit_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ func NewCommitStatus(opts NewCommitStatusOptions) error {
return fmt.Errorf("NewCommitStatus[%s, %s]: no user specified", repoPath, opts.SHA)
}

ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return fmt.Errorf("NewCommitStatus[repo_id: %d, user_id: %d, sha: %s]: %v", opts.Repo.ID, opts.Creator.ID, opts.SHA, err)
}
defer commiter.Close()
defer committer.Close()

opts.CommitStatus.Description = strings.TrimSpace(opts.CommitStatus.Description)
opts.CommitStatus.Context = strings.TrimSpace(opts.CommitStatus.Context)
Expand Down Expand Up @@ -243,7 +243,7 @@ func NewCommitStatus(opts NewCommitStatusOptions) error {
return fmt.Errorf("Insert CommitStatus[%s, %s]: %v", repoPath, opts.SHA, err)
}

return commiter.Commit()
return committer.Commit()
}

// SignCommitWithStatuses represents a commit with validation of signature and status state.
Expand Down
8 changes: 4 additions & 4 deletions models/consistency.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,11 @@ func CountOrphanedIssues() (int64, error) {

// DeleteOrphanedIssues delete issues without a repo
func DeleteOrphanedIssues() error {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

var ids []int64

Expand All @@ -286,10 +286,10 @@ func DeleteOrphanedIssues() error {
attachmentPaths = append(attachmentPaths, paths...)
}

if err := commiter.Commit(); err != nil {
if err := committer.Commit(); err != nil {
return err
}
commiter.Close()
committer.Close()

// Remove issue attachment files.
for i := range attachmentPaths {
Expand Down
6 changes: 3 additions & 3 deletions models/gpg_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,17 @@ func DeleteGPGKey(doer *User, id int64) (err error) {
return ErrGPGKeyAccessDenied{doer.ID, key.ID}
}

ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if _, err = deleteGPGKey(ctx.Engine(), key.KeyID); err != nil {
return err
}

return commiter.Commit()
return committer.Commit()
}

func checkKeyEmails(email string, keys ...*GPGKey) (bool, string) {
Expand Down
6 changes: 3 additions & 3 deletions models/gpg_key_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ func AddGPGKey(ownerID int64, content, token, signature string) ([]*GPGKey, erro
return nil, err
}

ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return nil, err
}
defer commiter.Close()
defer committer.Close()

keys := make([]*GPGKey, 0, len(ekeys))

Expand Down Expand Up @@ -123,5 +123,5 @@ func AddGPGKey(ownerID int64, content, token, signature string) ([]*GPGKey, erro
}
keys = append(keys, key)
}
return keys, commiter.Commit()
return keys, committer.Commit()
}
6 changes: 3 additions & 3 deletions models/gpg_key_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ import (

// VerifyGPGKey marks a GPG key as verified
func VerifyGPGKey(ownerID int64, keyID, token, signature string) (string, error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return "", err
}
defer commiter.Close()
defer committer.Close()

key := new(GPGKey)

Expand Down Expand Up @@ -96,7 +96,7 @@ func VerifyGPGKey(ownerID int64, keyID, token, signature string) (string, error)
return "", err
}

if err := commiter.Commit(); err != nil {
if err := committer.Commit(); err != nil {
return "", err
}

Expand Down
60 changes: 30 additions & 30 deletions models/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,11 @@ func (issue *Issue) clearLabels(e db.Engine, doer *User) (err error) {
// ClearLabels removes all issue labels as the given user.
// Triggers appropriate WebHooks, if any.
func (issue *Issue) ClearLabels(doer *User) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err := issue.loadRepo(ctx.Engine()); err != nil {
return err
Expand All @@ -491,7 +491,7 @@ func (issue *Issue) ClearLabels(doer *User) (err error) {
return err
}

if err = commiter.Commit(); err != nil {
if err = committer.Commit(); err != nil {
return fmt.Errorf("Commit: %v", err)
}

Expand All @@ -515,11 +515,11 @@ func (ts labelSorter) Swap(i, j int) {
// ReplaceLabels removes all current labels and add new labels to the issue.
// Triggers appropriate WebHooks, if any.
func (issue *Issue) ReplaceLabels(labels []*Label, doer *User) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = issue.loadRepo(ctx.Engine()); err != nil {
return err
Expand Down Expand Up @@ -577,7 +577,7 @@ func (issue *Issue) ReplaceLabels(labels []*Label, doer *User) (err error) {
return err
}

return commiter.Commit()
return committer.Commit()
}

// ReadBy sets issue to be read by given user.
Expand Down Expand Up @@ -682,11 +682,11 @@ func (issue *Issue) doChangeStatus(e db.Engine, doer *User, isMergePull bool) (*

// ChangeStatus changes issue status to open or closed.
func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (*Comment, error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return nil, err
}
defer commiter.Close()
defer committer.Close()

if err := issue.loadRepo(ctx.Engine()); err != nil {
return nil, err
Expand All @@ -700,7 +700,7 @@ func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (*Comment, error) {
return nil, err
}

if err = commiter.Commit(); err != nil {
if err = committer.Commit(); err != nil {
return nil, fmt.Errorf("Commit: %v", err)
}

Expand All @@ -709,11 +709,11 @@ func (issue *Issue) ChangeStatus(doer *User, isClosed bool) (*Comment, error) {

// ChangeTitle changes the title of this issue, as the given user.
func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = updateIssueCols(ctx.Engine(), issue, "name"); err != nil {
return fmt.Errorf("updateIssueCols: %v", err)
Expand All @@ -738,22 +738,22 @@ func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error) {
return err
}

return commiter.Commit()
return committer.Commit()
}

// ChangeRef changes the branch of this issue, as the given user.
func (issue *Issue) ChangeRef(doer *User, oldRef string) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = updateIssueCols(ctx.Engine(), issue, "ref"); err != nil {
return fmt.Errorf("updateIssueCols: %v", err)
}

return commiter.Commit()
return committer.Commit()
}

// AddDeletePRBranchComment adds delete branch comment for pull request issue
Expand All @@ -762,11 +762,11 @@ func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branc
if err != nil {
return err
}
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()
opts := &CreateCommentOptions{
Type: CommentTypeDeleteBranch,
Doer: doer,
Expand All @@ -778,16 +778,16 @@ func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branc
return err
}

return commiter.Commit()
return committer.Commit()
}

// UpdateAttachments update attachments by UUIDs for the issue
func (issue *Issue) UpdateAttachments(uuids []string) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()
attachments, err := getAttachmentsByUUIDs(ctx.Engine(), uuids)
if err != nil {
return fmt.Errorf("getAttachmentsByUUIDs [uuids: %v]: %v", uuids, err)
Expand All @@ -798,18 +798,18 @@ func (issue *Issue) UpdateAttachments(uuids []string) (err error) {
return fmt.Errorf("update attachment [id: %d]: %v", attachments[i].ID, err)
}
}
return commiter.Commit()
return committer.Commit()
}

// ChangeContent changes issue content, as the given user.
func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
issue.Content = content

ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = updateIssueCols(ctx.Engine(), issue, "content"); err != nil {
return fmt.Errorf("UpdateIssueCols: %v", err)
Expand All @@ -819,7 +819,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
return err
}

return commiter.Commit()
return committer.Commit()
}

// GetTasks returns the amount of tasks in the issues content
Expand Down Expand Up @@ -990,11 +990,11 @@ func newIssue(e db.Engine, doer *User, opts NewIssueOptions) (err error) {
// RecalculateIssueIndexForRepo create issue_index for repo if not exist and
// update it based on highest index of existing issues assigned to a repo
func RecalculateIssueIndexForRepo(repoID int64) error {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err := db.UpsertResourceIndex(ctx.Engine(), "issue_index", repoID); err != nil {
return err
Expand All @@ -1009,7 +1009,7 @@ func RecalculateIssueIndexForRepo(repoID int64) error {
return err
}

return commiter.Commit()
return committer.Commit()
}

// NewIssue creates new issue with labels for repository.
Expand All @@ -1021,11 +1021,11 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)

issue.Index = idx

ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = newIssue(ctx.Engine(), issue.Poster, NewIssueOptions{
Repo: repo,
Expand All @@ -1039,7 +1039,7 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
return fmt.Errorf("newIssue: %v", err)
}

if err = commiter.Commit(); err != nil {
if err = committer.Commit(); err != nil {
return fmt.Errorf("Commit: %v", err)
}

Expand Down
12 changes: 6 additions & 6 deletions models/issue_label.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ func NewLabel(label *Label) error {

// NewLabels creates new labels
func NewLabels(labels ...*Label) error {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

for _, label := range labels {
if !LabelColorPattern.MatchString(label.Color) {
Expand All @@ -275,7 +275,7 @@ func NewLabels(labels ...*Label) error {
return err
}
}
return commiter.Commit()
return committer.Commit()
}

// UpdateLabel updates label information.
Expand Down Expand Up @@ -744,11 +744,11 @@ func newIssueLabels(e db.Engine, issue *Issue, labels []*Label, doer *User) (err

// NewIssueLabels creates a list of issue-label relations.
func NewIssueLabels(issue *Issue, labels []*Label, doer *User) (err error) {
ctx, commiter, err := db.TxContext()
ctx, committer, err := db.TxContext()
if err != nil {
return err
}
defer commiter.Close()
defer committer.Close()

if err = newIssueLabels(ctx.Engine(), issue, labels, doer); err != nil {
return err
Expand All @@ -759,7 +759,7 @@ func NewIssueLabels(issue *Issue, labels []*Label, doer *User) (err error) {
return err
}

return commiter.Commit()
return committer.Commit()
}

func deleteIssueLabel(e db.Engine, issue *Issue, label *Label, doer *User) (err error) {
Expand Down
2 changes: 1 addition & 1 deletion models/list_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func setSessionPagination(sess *xorm.Session, p Paginator) *xorm.Session {
return sess.Limit(take, skip)
}

// setSessionPagination sets pagination for a database db.Engine
// setSessionPagination sets pagination for a database engine
func setEnginePagination(e db.Engine, p Paginator) db.Engine {
skip, take := p.GetSkipTake()

Expand Down
2 changes: 1 addition & 1 deletion modules/emoji/emoji_data.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dbd002d

Please sign in to comment.