summaryrefslogtreecommitdiffstats
path: root/models/git_diff.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-13 12:40:32 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-13 12:40:32 -0400
commit98dbbae2efd5c232d94f5e4d8df9d388cace2ebc (patch)
tree262ea9952e6c9f960ca86e839fb1f23cc8ee898c /models/git_diff.go
parentc117f9e73f148468c624f31be237af7a691533a0 (diff)
downloadgitea-98dbbae2efd5c232d94f5e4d8df9d388cace2ebc.tar.gz
gitea-98dbbae2efd5c232d94f5e4d8df9d388cace2ebc.zip
Fix #166
Diffstat (limited to 'models/git_diff.go')
-rw-r--r--models/git_diff.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/git_diff.go b/models/git_diff.go
index cf93af6959..8dd5a8c882 100644
--- a/models/git_diff.go
+++ b/models/git_diff.go
@@ -49,6 +49,7 @@ type DiffSection struct {
type DiffFile struct {
Name string
+ Index int
Addition, Deletion int
Type int
IsBin bool
@@ -144,6 +145,7 @@ func ParsePatch(reader io.Reader) (*Diff, error) {
curFile = &DiffFile{
Name: a[strings.Index(a, "/")+1:],
+ Index: len(diff.Files) + 1,
Type: DIFF_FILE_CHANGE,
Sections: make([]*DiffSection, 0, 10),
}