diff options
author | Andrey Nering <andrey.nering@gmail.com> | 2016-01-07 11:27:35 -0200 |
---|---|---|
committer | Andrey Nering <andrey.nering@gmail.com> | 2016-01-07 11:27:35 -0200 |
commit | bf11ad19eab0de5aef297a21ed58c6cd811a137c (patch) | |
tree | 55c36128b1209895d9406fe58cda0e5627020e9b /models/git_diff.go | |
parent | 81ed5c4bee112beacd8e0f34b336b4f3b6c6a6c1 (diff) | |
download | gitea-bf11ad19eab0de5aef297a21ed58c6cd811a137c.tar.gz gitea-bf11ad19eab0de5aef297a21ed58c6cd811a137c.zip |
Semantic fixes.
Diffstat (limited to 'models/git_diff.go')
-rw-r--r-- | models/git_diff.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/models/git_diff.go b/models/git_diff.go index 2b9bda2531..ec1fc1890b 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -19,31 +19,31 @@ import ( "github.com/Unknwon/com" "golang.org/x/net/html/charset" "golang.org/x/text/transform" + "github.com/sergi/go-diff/diffmatchpatch" "github.com/gogits/git-module" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" "github.com/gogits/gogs/modules/process" - "github.com/sergi/go-diff/diffmatchpatch" ) type DiffLineType uint8 const ( - DIFF_LINE_PLAIN DiffLineType = iota + 1 - DIFF_LINE_ADD DiffLineType = iota + 1 - DIFF_LINE_DEL DiffLineType = iota + 1 - DIFF_LINE_SECTION DiffLineType = iota + 1 + DIFF_LINE_PLAIN DiffLineType = iota + 1 + DIFF_LINE_ADD + DIFF_LINE_DEL + DIFF_LINE_SECTION ) type DiffFileType uint8 const ( - DIFF_FILE_ADD DiffFileType = iota + 1 - DIFF_FILE_CHANGE DiffFileType = iota + 1 - DIFF_FILE_DEL DiffFileType = iota + 1 - DIFF_FILE_RENAME DiffFileType = iota + 1 + DIFF_FILE_ADD DiffFileType = iota + 1 + DIFF_FILE_CHANGE + DIFF_FILE_DEL + DIFF_FILE_RENAME ) type DiffLine struct { @@ -80,7 +80,7 @@ func diffToHtml(diffRecord []diffmatchpatch.Diff, lineType DiffLineType) templat func (diffSection *DiffSection) GetLeftLine(idx int, sliceIdx int) *DiffLine { for i, diffLine := range diffSection.Lines { if diffLine.LeftIdx == idx && diffLine.RightIdx == 0 { - // ignore the the lines are too far from each other + // ignore if the lines are too far from each other if i > sliceIdx-5 && i < sliceIdx+5 { return diffLine } else { @@ -94,7 +94,7 @@ func (diffSection *DiffSection) GetLeftLine(idx int, sliceIdx int) *DiffLine { func (diffSection *DiffSection) GetRightLine(idx int, sliceIdx int) *DiffLine { for i, diffLine := range diffSection.Lines { if diffLine.RightIdx == idx && diffLine.LeftIdx == 0 { - // ignore the the lines are too far from each other + // ignore if the lines are too far from each other if i > sliceIdx-5 && i < sliceIdx+5 { return diffLine } else { |