ignore: support backslash escaping

Use the new `Globset::backslash_escape` knob to conform to git behavior:
`\` will escape the following character. For example, the pattern `\*`
will match a file literally named `*`.

Also tweak a test in ripgrep that was relying on this incorrect
behavior.

Closes #526, Closes #811
This commit is contained in:
Brian Malehorn
2018-02-22 23:15:16 -08:00
committed by Andrew Gallant
parent 54256515b4
commit 91d0756f62
2 changed files with 6 additions and 5 deletions

View File

@@ -800,11 +800,7 @@ clean!(regression_25, "test", ".", |wd: WorkDir, mut cmd: Command| {
// See: https://github.com/BurntSushi/ripgrep/issues/30
clean!(regression_30, "test", ".", |wd: WorkDir, mut cmd: Command| {
if cfg!(windows) {
wd.create(".gitignore", "vendor/**\n!vendor\\manifest");
} else {
wd.create(".gitignore", "vendor/**\n!vendor/manifest");
}
wd.create(".gitignore", "vendor/**\n!vendor/manifest");
wd.create_dir("vendor");
wd.create("vendor/manifest", "test");