From 3a27a0c1462302c668168e77497339863f3576cc Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 26 Mar 2014 18:02:08 +0800 Subject: improved diff --- models/git.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'models') diff --git a/models/git.go b/models/git.go index 5b2a4060..6df8d4ec 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) -- cgit v1.2.3