summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Spielmann <martin.spielmann@pingunaut.com>2017-01-28 15:24:57 +0100
committerFlorian Zschocke <florian.zschocke@devolo.de>2019-06-10 22:14:13 +0200
commit3bff35cdbc7136e5d945c9f2830aa4fdcde19f75 (patch)
tree16ec5fe15e163b7932b75f1684ae60fc9751795c /src
parenta98689880e3568eb745fd76b054e9e33fca0857c (diff)
downloadgitblit-3bff35cdbc7136e5d945c9f2830aa4fdcde19f75.tar.gz
gitblit-3bff35cdbc7136e5d945c9f2830aa4fdcde19f75.zip
Escape folder names in JGitUtils to allow special characters. Fixes #999
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/gitblit/utils/JGitUtils.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/gitblit/utils/JGitUtils.java b/src/main/java/com/gitblit/utils/JGitUtils.java
index 0eea1d61..e70b4f99 100644
--- a/src/main/java/com/gitblit/utils/JGitUtils.java
+++ b/src/main/java/com/gitblit/utils/JGitUtils.java
@@ -954,9 +954,9 @@ public class JGitUtils {
List<String> paths = new ArrayList<>();
while (tw.next()) {
- String child = isPathEmpty ? tw.getPathString()
- : tw.getPathString().replaceFirst(String.format("%s/", path), "");
- paths.add(child);
+ String pathString = tw.getPathString();
+ String child = isPathEmpty ? pathString : pathString.replaceFirst(Pattern.quote(String.format("%s/", path)), "");
+ paths.add(child);
}
for(String p: PathUtils.compressPaths(paths)) {