diff options
author | Unknwon <u@gogs.io> | 2015-08-20 16:08:26 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-20 16:08:26 +0800 |
commit | 9b42f53aa833a6ca54dd48ca0e3cdaff984aa793 (patch) | |
tree | 58da7429601a8da5a4aade526956a83247ffb96c /models/git_diff.go | |
parent | ac616c07de95b8e91ec2a3ac321d1802856f55c6 (diff) | |
download | gitea-9b42f53aa833a6ca54dd48ca0e3cdaff984aa793.tar.gz gitea-9b42f53aa833a6ca54dd48ca0e3cdaff984aa793.zip |
more on #966
Diffstat (limited to 'models/git_diff.go')
-rw-r--r-- | models/git_diff.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/git_diff.go b/models/git_diff.go index 9681b3f465..6698565001 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -169,6 +169,12 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff beg := len(DIFF_HEAD) 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{ Name: a[strings.Index(a, "/")+1:], Index: len(diff.Files) + 1, |