From 0c9eb468e9a55f933286a45f366f41a7a4e79637 Mon Sep 17 00:00:00 2001 From: Gjergji Ramku Date: Thu, 20 Aug 2020 16:53:06 +0200 Subject: [PATCH] Fix typos (#12542) Signed-off-by: Gjergji Ramku --- routers/private/hook.go | 4 ++-- routers/private/serv.go | 2 +- routers/repo/compare.go | 2 +- services/gitdiff/gitdiff.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/routers/private/hook.go b/routers/private/hook.go index 215793c9709..6cdc5393f42 100644 --- a/routers/private/hook.go +++ b/routers/private/hook.go @@ -557,7 +557,7 @@ func SetDefaultBranch(ctx *macaron.Context) { if !git.IsErrUnsupportedVersion(err) { gitRepo.Close() ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ - "Err": fmt.Sprintf("Unable to set default branch onrepository: %s/%s Error: %v", ownerName, repoName, err), + "Err": fmt.Sprintf("Unable to set default branch on repository: %s/%s Error: %v", ownerName, repoName, err), }) return } @@ -566,7 +566,7 @@ func SetDefaultBranch(ctx *macaron.Context) { if err := repo.UpdateDefaultBranch(); err != nil { ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ - "Err": fmt.Sprintf("Unable to set default branch onrepository: %s/%s Error: %v", ownerName, repoName, err), + "Err": fmt.Sprintf("Unable to set default branch on repository: %s/%s Error: %v", ownerName, repoName, err), }) return } diff --git a/routers/private/serv.go b/routers/private/serv.go index d5b5fcc8f7e..2e79fd79acd 100644 --- a/routers/private/serv.go +++ b/routers/private/serv.go @@ -80,7 +80,7 @@ func ServCommand(ctx *macaron.Context) { KeyID: keyID, } - // Now because we're not translating things properly let's just default some Engish strings here + // Now because we're not translating things properly let's just default some English strings here modeString := "read" if mode > models.AccessModeRead { modeString = "write to" diff --git a/routers/repo/compare.go b/routers/repo/compare.go index fb78ebdeacd..f8a18f06967 100644 --- a/routers/repo/compare.go +++ b/routers/repo/compare.go @@ -598,7 +598,7 @@ func ExcerptBlob(ctx *context.Context) { direction := ctx.Query("direction") filePath := ctx.Query("path") gitRepo := ctx.Repo.GitRepo - chunkSize := gitdiff.BlobExceprtChunkSize + chunkSize := gitdiff.BlobExcerptChunkSize commit, err := gitRepo.GetCommit(commitID) if err != nil { ctx.Error(500, "GetCommit") diff --git a/services/gitdiff/gitdiff.go b/services/gitdiff/gitdiff.go index d50ae6ae277..fd07a2ad966 100644 --- a/services/gitdiff/gitdiff.go +++ b/services/gitdiff/gitdiff.go @@ -89,8 +89,8 @@ type DiffLineSectionInfo struct { RightHunkSize int } -// BlobExceprtChunkSize represent max lines of excerpt -const BlobExceprtChunkSize = 20 +// BlobExcerptChunkSize represent max lines of excerpt +const BlobExcerptChunkSize = 20 // GetType returns the type of a DiffLine. func (d *DiffLine) GetType() int { @@ -139,7 +139,7 @@ func (d *DiffLine) GetExpandDirection() DiffLineExpandDirection { } if d.SectionInfo.LastLeftIdx <= 0 && d.SectionInfo.LastRightIdx <= 0 { return DiffLineExpandUp - } else if d.SectionInfo.RightIdx-d.SectionInfo.LastRightIdx > BlobExceprtChunkSize && d.SectionInfo.RightHunkSize > 0 { + } else if d.SectionInfo.RightIdx-d.SectionInfo.LastRightIdx > BlobExcerptChunkSize && d.SectionInfo.RightHunkSize > 0 { return DiffLineExpandUpDown } else if d.SectionInfo.LeftHunkSize <= 0 && d.SectionInfo.RightHunkSize <= 0 { return DiffLineExpandDown