From ac616c07de95b8e91ec2a3ac321d1802856f55c6 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 20 Aug 2015 15:57:51 +0800 Subject: [PATCH] fix #966 --- modules/git/tree.go | 7 +++++++ templates/repo/issue/view_content.tmpl | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/git/tree.go b/modules/git/tree.go index be77bfce0..27539f06b 100644 --- a/modules/git/tree.go +++ b/modules/git/tree.go @@ -71,6 +71,13 @@ func parseTreeData(tree *Tree, data []byte) ([]*TreeEntry, error) { step = bytes.IndexByte(data[pos:], '\n') entry.name = string(data[pos : pos+step]) + + // In case entry name is surrounded by double quotes(it happens only in git-shell). + if entry.name[0] == '"' { + entry.name = string(data[pos+1 : pos+step-1]) + entry.name = strings.Replace(entry.name, `\"`, `"`, -1) + } + pos += step + 1 entries = append(entries, entry) } diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index ad3c471bb..a52d4fd63 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -102,7 +102,7 @@ {{end}} {{if or $.IsRepositoryAdmin (eq .Poster.Id $.SignedUserID)}} - + {{end}}