summaryrefslogtreecommitdiffstats
path: root/ignore/src/gitignore.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ignore/src/gitignore.rs')
-rw-r--r--ignore/src/gitignore.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/ignore/src/gitignore.rs b/ignore/src/gitignore.rs
index 7e7233d6..83392e1e 100644
--- a/ignore/src/gitignore.rs
+++ b/ignore/src/gitignore.rs
@@ -477,6 +477,7 @@ impl GitignoreBuilder {
GlobBuilder::new(&glob.actual)
.literal_separator(literal_separator)
.case_insensitive(self.case_insensitive)
+ .backslash_escape(true)
.build()
.map_err(|err| {
Error::Glob {
@@ -635,6 +636,10 @@ mod tests {
ignored!(ig35, "./.", ".a/b", ".a/b");
ignored!(ig36, "././", ".a/b", ".a/b");
ignored!(ig37, "././.", ".a/b", ".a/b");
+ ignored!(ig38, ROOT, "\\[", "[");
+ ignored!(ig39, ROOT, "\\?", "?");
+ ignored!(ig40, ROOT, "\\*", "*");
+ ignored!(ig41, ROOT, "\\a", "a");
not_ignored!(ignot1, ROOT, "amonths", "months");
not_ignored!(ignot2, ROOT, "monthsa", "months");