1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-11 11:28:02 -05:00

Allow spaces in file/dir names on parsing git diff

This commit is contained in:
Vladimir Vissoultchev 2015-07-28 19:48:36 +03:00
parent 72377c721c
commit fac4e27882

View file

@ -167,8 +167,8 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff
return diff, nil return diff, nil
} }
fs := strings.Split(line[len(DIFF_HEAD):], " ") beg := len(DIFF_HEAD)
a := fs[0] a := line[beg : (len(line)-beg)/2+beg]
curFile = &DiffFile{ curFile = &DiffFile{
Name: a[strings.Index(a, "/")+1:], Name: a[strings.Index(a, "/")+1:],