Improve fragment validation, track context lines

Track leading and trailing context lines because it's easy and Git
includes this information in the fragment type. Add validation for when
the fragment does not agree with the header or with the new/deleted
state of the file.
This commit is contained in:
Billy Keyes
2019-03-29 22:31:27 -07:00
parent 7483884180
commit 2c9be20fca
2 changed files with 37 additions and 3 deletions
+3
View File
@@ -39,6 +39,9 @@ type Fragment struct {
LinesAdded int64
LinesDeleted int64
LeadingContext int64
TrailingContext int64
Lines []FragmentLine
}