Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-28 04:36:11 +01:00
This commit is contained in:
Unknwon 2015-08-20 16:08:26 +08:00
parent ac616c07de
commit 9b42f53aa8

View file

@ -169,6 +169,12 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff
beg := len(DIFF_HEAD) beg := len(DIFF_HEAD)
a := line[beg : (len(line)-beg)/2+beg] a := line[beg : (len(line)-beg)/2+beg]
// In case file name is surrounded by double quotes(it happens only in git-shell).
if a[0] == '"' {
a = a[1 : len(a)-1]
a = strings.Replace(a, `\"`, `"`, -1)
}
curFile = &DiffFile{ curFile = &DiffFile{
Name: a[strings.Index(a, "/")+1:], Name: a[strings.Index(a, "/")+1:],
Index: len(diff.Files) + 1, Index: len(diff.Files) + 1,