Skip to content

Commit

Permalink
spell corection
Browse files Browse the repository at this point in the history
Co-Authored-By: zeripath <[email protected]>
  • Loading branch information
6543 and zeripath committed Dec 23, 2019
1 parent 4284585 commit cde6879
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion modules/repofiles/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func DeleteRepoFile(repo *models.Repository, doer *models.User, opts *DeleteRepo
// Now commit the tree
var commitHash string
if opts.Dates != nil {
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Dates.Author, opts.Dates.Commiter)
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Dates.Author, opts.Dates.Committer)
} else {
commitHash, err = t.CommitTree(author, committer, treeHash, message)
}
Expand Down
4 changes: 2 additions & 2 deletions modules/repofiles/temp_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (t *TemporaryUploadRepository) CommitTree(author, committer *models.User, t
}

// CommitTreeWithDate creates a commit from a given tree for the user with provided message
func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models.User, treeHash string, message string, authorDate, commiterDate time.Time) (string, error) {
func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models.User, treeHash string, message string, authorDate, committerDate time.Time) (string, error) {
authorSig := author.NewGitSig()
committerSig := committer.NewGitSig()

Expand All @@ -208,7 +208,7 @@ func (t *TemporaryUploadRepository) CommitTreeWithDate(author, committer *models
"GIT_AUTHOR_DATE="+authorDate.Format(time.RFC3339),
"GIT_COMMITTER_NAME="+committerSig.Name,
"GIT_COMMITTER_EMAIL="+committerSig.Email,
"GIT_COMMITTER_DATE="+commiterDate.Format(time.RFC3339),
"GIT_COMMITTER_DATE="+committerDate.Format(time.RFC3339),
)

messageBytes := new(bytes.Buffer)
Expand Down
6 changes: 3 additions & 3 deletions modules/repofiles/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ type IdentityOptions struct {

// CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE
type CommitDateOptions struct {
Author time.Time
Commiter time.Time
Author time.Time
Committer time.Time
}

// UpdateRepoFileOptions holds the repository file update options
Expand Down Expand Up @@ -381,7 +381,7 @@ func CreateOrUpdateRepoFile(repo *models.Repository, doer *models.User, opts *Up
// Now commit the tree
var commitHash string
if opts.Dates != nil {
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Dates.Author, opts.Dates.Commiter)
commitHash, err = t.CommitTreeWithDate(author, committer, treeHash, message, opts.Dates.Author, opts.Dates.Committer)
} else {
commitHash, err = t.CommitTree(author, committer, treeHash, message)
}
Expand Down
2 changes: 1 addition & 1 deletion modules/structs/repo_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ type CommitDateOptions struct {
// swagger:strfmt date-time
Author time.Time `json:"author"`
// swagger:strfmt date-time
Commiter time.Time `json:"commiter"`
Committer time.Time `json:"committer"`
}
24 changes: 12 additions & 12 deletions routers/api/v1/repo/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ func CreateFile(ctx *context.APIContext, apiOpts api.CreateFileOptions) {
Email: apiOpts.Author.Email,
},
Dates: &repofiles.CommitDateOptions{
Author: apiOpts.Dates.Author,
Commiter: apiOpts.Dates.Author,
Author: apiOpts.Dates.Author,
Committer: apiOpts.Dates.Committer,
},
}
if opts.Dates.Author.IsZero() {
opts.Dates.Author = time.Now()
}
if opts.Dates.Commiter.IsZero() {
opts.Dates.Commiter = time.Now()
if opts.Dates.Committer.IsZero() {
opts.Dates.Committer = time.Now()
}

if opts.Message == "" {
Expand Down Expand Up @@ -289,15 +289,15 @@ func UpdateFile(ctx *context.APIContext, apiOpts api.UpdateFileOptions) {
Email: apiOpts.Author.Email,
},
Dates: &repofiles.CommitDateOptions{
Author: apiOpts.Dates.Author,
Commiter: apiOpts.Dates.Author,
Author: apiOpts.Dates.Author,
Committer: apiOpts.Dates.Committer,
},
}
if opts.Dates.Author.IsZero() {
opts.Dates.Author = time.Now()
}
if opts.Dates.Commiter.IsZero() {
opts.Dates.Commiter = time.Now()
if opts.Dates.Committer.IsZero() {
opts.Dates.Committer = time.Now()
}

if opts.Message == "" {
Expand Down Expand Up @@ -386,15 +386,15 @@ func DeleteFile(ctx *context.APIContext, apiOpts api.DeleteFileOptions) {
Email: apiOpts.Author.Email,
},
Dates: &repofiles.CommitDateOptions{
Author: apiOpts.Dates.Author,
Commiter: apiOpts.Dates.Author,
Author: apiOpts.Dates.Author,
Committer: apiOpts.Dates.Committer,
},
}
if opts.Dates.Author.IsZero() {
opts.Dates.Author = time.Now()
}
if opts.Dates.Commiter.IsZero() {
opts.Dates.Commiter = time.Now()
if opts.Dates.Committer.IsZero() {
opts.Dates.Committer = time.Now()
}

if opts.Message == "" {
Expand Down
4 changes: 2 additions & 2 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8282,10 +8282,10 @@
"format": "date-time",
"x-go-name": "Author"
},
"commiter": {
"committer": {
"type": "string",
"format": "date-time",
"x-go-name": "Commiter"
"x-go-name": "Committer"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
Expand Down

0 comments on commit cde6879

Please sign in to comment.