From 279eaf069004b8dca523f1ecb231c1df02ac9031 Mon Sep 17 00:00:00 2001 From: Dmitry Pavlenko Date: Fri, 15 Dec 2017 21:15:35 +0100 Subject: Strings#convertGlob: fix escaping of patterns like [\[]. Originally the patterns were escaped twice leading to wrong matching results. Bug: 528886 Change-Id: I26e201b4b0ef51cac08f940b76f381260fa925ca Signed-off-by: Dmitry Pavlenko Signed-off-by: David Pursehouse --- org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java index 79df1511d1..800cdb9952 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/ignore/internal/Strings.java @@ -363,7 +363,10 @@ public class Strings { case '[': if (in_brackets > 0) { - sb.append('\\').append('['); + if (!seenEscape) { + sb.append('\\'); + } + sb.append('['); ignoreLastBracket = true; } else { if (!seenEscape) { -- cgit v1.2.3