index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
path:
root
/
models
/
git_diff.go
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Andrey Nering <andrey.nering@gmail.com>
2016-02-21 18:45:24 -0300
committer
Andrey Nering <andrey.nering@gmail.com>
2016-02-21 18:45:24 -0300
commit
d160c7e565ef3c3429ca601b5a10b13949579b36
(
patch
)
tree
a69cefeb2419ece9f0ee102f2fdf986ce3d6d3ee
/
models/git_diff.go
parent
8ac04a3f291c5cf1a9474c1affeb04a1f94ea5a8
(
diff
)
Little refactoring of diff highlight.
Moving cache variable to template instead of in the struct.
Diffstat
(limited to 'models/git_diff.go')
-rw-r--r--
models/git_diff.go
6
1 files changed, 1 insertions, 5 deletions
diff --git a/models/git_diff.go b/models/git_diff.go
index 9796ef59..ab70139f 100644
--- a/
models/git_diff.go
+++ b/
models/git_diff.go
@@ -161,7 +161,6 @@ type DiffFile struct {
IsBin bool
IsRenamed bool
Sections []*DiffSection
- HighlightClass string
}
func (diffFile *DiffFile) GetType() int {
@@ -169,10 +168,7 @@ func (diffFile *DiffFile) GetType() int {
}
func (diffFile *DiffFile) GetHighlightClass() string {
- if diffFile.HighlightClass == "" {
- diffFile.HighlightClass = highlight.FileNameToHighlightClass(diffFile.Name)
- }
- return diffFile.HighlightClass
+ return highlight.FileNameToHighlightClass(diffFile.Name)
}
type Diff struct {