Browse Source

Fix typos (#12542)

Signed-off-by: Gjergji Ramku <gjergjiramku@gmail.com>
for-closed-social
Gjergji Ramku 4 years ago
committed by GitHub
parent
commit
0c9eb468e9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions
  1. +2
    -2
      routers/private/hook.go
  2. +1
    -1
      routers/private/serv.go
  3. +1
    -1
      routers/repo/compare.go
  4. +3
    -3
      services/gitdiff/gitdiff.go

+ 2
- 2
routers/private/hook.go View File

@ -557,7 +557,7 @@ func SetDefaultBranch(ctx *macaron.Context) {
if !git.IsErrUnsupportedVersion(err) { if !git.IsErrUnsupportedVersion(err) {
gitRepo.Close() gitRepo.Close()
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ 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 return
} }
@ -566,7 +566,7 @@ func SetDefaultBranch(ctx *macaron.Context) {
if err := repo.UpdateDefaultBranch(); err != nil { if err := repo.UpdateDefaultBranch(); err != nil {
ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ 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 return
} }

+ 1
- 1
routers/private/serv.go View File

@ -80,7 +80,7 @@ func ServCommand(ctx *macaron.Context) {
KeyID: keyID, 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" modeString := "read"
if mode > models.AccessModeRead { if mode > models.AccessModeRead {
modeString = "write to" modeString = "write to"

+ 1
- 1
routers/repo/compare.go View File

@ -598,7 +598,7 @@ func ExcerptBlob(ctx *context.Context) {
direction := ctx.Query("direction") direction := ctx.Query("direction")
filePath := ctx.Query("path") filePath := ctx.Query("path")
gitRepo := ctx.Repo.GitRepo gitRepo := ctx.Repo.GitRepo
chunkSize := gitdiff.BlobExceprtChunkSize
chunkSize := gitdiff.BlobExcerptChunkSize
commit, err := gitRepo.GetCommit(commitID) commit, err := gitRepo.GetCommit(commitID)
if err != nil { if err != nil {
ctx.Error(500, "GetCommit") ctx.Error(500, "GetCommit")

+ 3
- 3
services/gitdiff/gitdiff.go View File

@ -89,8 +89,8 @@ type DiffLineSectionInfo struct {
RightHunkSize int 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. // GetType returns the type of a DiffLine.
func (d *DiffLine) GetType() int { func (d *DiffLine) GetType() int {
@ -139,7 +139,7 @@ func (d *DiffLine) GetExpandDirection() DiffLineExpandDirection {
} }
if d.SectionInfo.LastLeftIdx <= 0 && d.SectionInfo.LastRightIdx <= 0 { if d.SectionInfo.LastLeftIdx <= 0 && d.SectionInfo.LastRightIdx <= 0 {
return DiffLineExpandUp 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 return DiffLineExpandUpDown
} else if d.SectionInfo.LeftHunkSize <= 0 && d.SectionInfo.RightHunkSize <= 0 { } else if d.SectionInfo.LeftHunkSize <= 0 && d.SectionInfo.RightHunkSize <= 0 {
return DiffLineExpandDown return DiffLineExpandDown

Loading…
Cancel
Save