summaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-20 15:57:51 +0800
committerUnknwon <u@gogs.io>2015-08-20 15:57:51 +0800
commitac616c07de95b8e91ec2a3ac321d1802856f55c6 (patch)
tree66b727b15d8b044924989d6b15631c1b29f7a244 /modules/git
parent78b717f202dd989f3871fccd0bc8935fe709fac1 (diff)
downloadgitea-ac616c07de95b8e91ec2a3ac321d1802856f55c6.tar.gz
gitea-ac616c07de95b8e91ec2a3ac321d1802856f55c6.zip
fix #966
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/tree.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/git/tree.go b/modules/git/tree.go
index be77bfce02..27539f06b2 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)
}