summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-03-26 18:02:08 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-03-26 18:02:08 +0800
commit3a27a0c1462302c668168e77497339863f3576cc (patch)
tree40a0fbfe331d03c91bcfad21666a732718b37fdc /models
parent74b3c953def27d91761cb487c1984dcebd346d29 (diff)
downloadgitea-3a27a0c1462302c668168e77497339863f3576cc.tar.gz
gitea-3a27a0c1462302c668168e77497339863f3576cc.zip
improved diff
Diffstat (limited to 'models')
-rw-r--r--models/git.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/git.go b/models/git.go
index 5b2a4060b4..6df8d4ec91 100644
--- a/models/git.go
+++ b/models/git.go
@@ -291,6 +291,8 @@ func ParsePatch(reader io.Reader) (*Diff, error) {
curSection.Lines = append(curSection.Lines, diffLine)
continue
} else if line[0] == '@' {
+ curSection = &DiffSection{}
+ curFile.Sections = append(curFile.Sections, curSection)
ss := strings.Split(line, "@@")
diffLine := &DiffLine{Type: SectionLine, Content:"@@ "+ss[len(ss)-2]}
curSection.Lines = append(curSection.Lines, diffLine)