improved diff
This commit is contained in:
parent
74b3c953de
commit
3a27a0c146
2 changed files with 6 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue