diff options
author | Vladimir Vissoultchev <wqweto@gmail.com> | 2015-07-28 19:48:36 +0300 |
---|---|---|
committer | Vladimir Vissoultchev <wqweto@gmail.com> | 2015-07-28 19:48:36 +0300 |
commit | fac4e27882f412faf3ddf8661bdba76732a35292 (patch) | |
tree | 5a0c370d02294a00edb1ec42a31e9fa552b06370 /models/git_diff.go | |
parent | 72377c721cc7c164a511080630f10ff4e373cadc (diff) | |
download | gitea-fac4e27882f412faf3ddf8661bdba76732a35292.tar.gz gitea-fac4e27882f412faf3ddf8661bdba76732a35292.zip |
Allow spaces in file/dir names on parsing git diff
Diffstat (limited to 'models/git_diff.go')
-rw-r--r-- | models/git_diff.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/git_diff.go b/models/git_diff.go index 9d34ed6271..0ff2c3a728 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -167,8 +167,8 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff return diff, nil } - fs := strings.Split(line[len(DIFF_HEAD):], " ") - a := fs[0] + beg := len(DIFF_HEAD) + a := line[beg : (len(line)-beg)/2+beg] curFile = &DiffFile{ Name: a[strings.Index(a, "/")+1:], |