From 9835e2ae736235810b4ea1c162ca5e65c547e770 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:50 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/ignore/.cargo-checksum.json | 2 +- vendor/ignore/Cargo.lock | 55 +++++++++++++++------------ vendor/ignore/Cargo.toml | 32 ++++++++++------ vendor/ignore/src/default_types.rs | 78 +++++++++++++++++++++++++++++++------- vendor/ignore/src/dir.rs | 15 +++++--- vendor/ignore/src/gitignore.rs | 11 ++++-- vendor/ignore/src/overrides.rs | 1 + vendor/ignore/src/types.rs | 12 +----- vendor/ignore/src/walk.rs | 9 ++--- 9 files changed, 139 insertions(+), 76 deletions(-) (limited to 'vendor/ignore') diff --git a/vendor/ignore/.cargo-checksum.json b/vendor/ignore/.cargo-checksum.json index 7e053c4ae..a7938c57b 100644 --- a/vendor/ignore/.cargo-checksum.json +++ b/vendor/ignore/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"5651ffb9fc59332411c504452f6391991d31714b6a90e5d9e4c887cb30336956","Cargo.toml":"67cc724370176b9ddfaebb57534245975d8b0f2e7521b47d5cc67d9c69ba2fdb","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"fad351a4d6dad422368750be404b7a419bc9f6ab5acc86934edb3502fba2029d","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","examples/walk.rs":"efad5c51147fb5020cf2b5d3c23cb8b10dd9f272be37d4c3149f6354fc2ee1f0","src/default_types.rs":"ca3e3031259f3069de0b000fc25574b1f5447a4e21b96d566ce4b030d09a2e40","src/dir.rs":"eb29357bba8e145ff4b09de8090c918c61dd096c5f1edbbeb40e3111bc310515","src/gitignore.rs":"7cb15661f83f66d914091449d3ec8c18a608ed63449c699bb8b2600eccb5c5c2","src/lib.rs":"1daba870ede6e78d508d44c8635b894b89dd8f38cb2624eefac18a6e3848100d","src/overrides.rs":"fd5bdbd80b7a78ddb0679a2270bfeebfa383de4a099c4baeb85fd0e1c0de3de7","src/pathutil.rs":"146b00e5dcb80dd9d9f43b9f42fe5600c3e72a31b47cba8f7ce3f6d2dc877fc1","src/types.rs":"a8b076c9960e0918adc2ef1fdd8190746bb56879ede960c0e67cf9eaa6eca61c","src/walk.rs":"a6878236aa66d86d5cf293c3ad25b5e4cd2d349f9eecd3760e2df14037f19b17","tests/gitignore_matched_path_or_any_parents_tests.gitignore":"3895c935f76a57928cc12284dfff406693b7666c0ffce9b8676c6c1976debe2d","tests/gitignore_matched_path_or_any_parents_tests.rs":"715fa13a13c1bec0731c14dbb0b81f12d74b2c021e110474e4cbc76fd13af7f2"},"package":"713f1b139373f96a2e0ce3ac931cd01ee973c3c5dd7c40c0c2efe96ad2b6751d"} \ No newline at end of file +{"files":{"COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.lock":"ac7f13d7cdfcd775f3485ee8c33899e64a8e09ed57c2746a0ad53334a4ad905a","Cargo.toml":"8b4f826e98ee5771bdc9a2dc64a9e89d8089ecec11c54498a7af5180722a2e61","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"fad351a4d6dad422368750be404b7a419bc9f6ab5acc86934edb3502fba2029d","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","examples/walk.rs":"efad5c51147fb5020cf2b5d3c23cb8b10dd9f272be37d4c3149f6354fc2ee1f0","src/default_types.rs":"82a964c32a9ad1afe4188cf986bc5e943ab325ad18c2e410c160f3dd13243691","src/dir.rs":"b1216258129e859a0ac9f20018840901bdcec95d82c339052d99167978d42456","src/gitignore.rs":"7e3bc151fbc92e05d4a5913a436c75afd173718974718a49707773e21de8b262","src/lib.rs":"1daba870ede6e78d508d44c8635b894b89dd8f38cb2624eefac18a6e3848100d","src/overrides.rs":"06625e2fb723bb90bdbb867abeaca2fd4293702d29439d9cdb647ed1e22f7dab","src/pathutil.rs":"146b00e5dcb80dd9d9f43b9f42fe5600c3e72a31b47cba8f7ce3f6d2dc877fc1","src/types.rs":"635ed3fad2b8360c8fc12f0b455a154c28642e3acf61457d40dd689b62359643","src/walk.rs":"e0129a6559446d0d4949948b2b19d643de8bdf4a836f07618bc9da9c72cb9c12","tests/gitignore_matched_path_or_any_parents_tests.gitignore":"3895c935f76a57928cc12284dfff406693b7666c0ffce9b8676c6c1976debe2d","tests/gitignore_matched_path_or_any_parents_tests.rs":"715fa13a13c1bec0731c14dbb0b81f12d74b2c021e110474e4cbc76fd13af7f2"},"package":"dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492"} \ No newline at end of file diff --git a/vendor/ignore/Cargo.lock b/vendor/ignore/Cargo.lock index 67dc86bc4..c64e5168e 100644 --- a/vendor/ignore/Cargo.lock +++ b/vendor/ignore/Cargo.lock @@ -4,20 +4,21 @@ version = 3 [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] [[package]] name = "bstr" -version = "0.2.16" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" dependencies = [ "memchr", + "serde", ] [[package]] @@ -28,9 +29,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "crossbeam-channel" -version = "0.5.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if", "crossbeam-utils", @@ -38,12 +39,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.5" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" dependencies = [ "cfg-if", - "lazy_static", ] [[package]] @@ -54,9 +54,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "globset" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0fc1b9fa0e64ffb1aa5b95daa0f0f167734fd528b7c02eabc581d9d843649b1" +checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc" dependencies = [ "aho-corasick", "bstr", @@ -67,10 +67,9 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.18" +version = "0.4.20" dependencies = [ "crossbeam-channel", - "crossbeam-utils", "globset", "lazy_static", "log", @@ -90,30 +89,30 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "log" -version = "0.4.14" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] [[package]] name = "memchr" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "once_cell" -version = "1.7.2" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "regex" -version = "1.5.4" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -122,9 +121,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "same-file" @@ -135,11 +134,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "serde" +version = "1.0.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" + [[package]] name = "thread_local" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ "once_cell", ] diff --git a/vendor/ignore/Cargo.toml b/vendor/ignore/Cargo.toml index 5f823960a..b397dcf8d 100644 --- a/vendor/ignore/Cargo.toml +++ b/vendor/ignore/Cargo.toml @@ -3,34 +3,40 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "ignore" -version = "0.4.18" +version = "0.4.20" authors = ["Andrew Gallant "] -description = "A fast library for efficiently matching ignore files such as `.gitignore`\nagainst file paths.\n" +description = """ +A fast library for efficiently matching ignore files such as `.gitignore` +against file paths. +""" homepage = "https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore" documentation = "https://docs.rs/ignore" readme = "README.md" -keywords = ["glob", "ignore", "gitignore", "pattern", "file"] -license = "Unlicense/MIT" +keywords = [ + "glob", + "ignore", + "gitignore", + "pattern", + "file", +] +license = "Unlicense OR MIT" repository = "https://github.com/BurntSushi/ripgrep/tree/master/crates/ignore" [lib] name = "ignore" bench = false -[dependencies.crossbeam-utils] -version = "0.8.0" [dependencies.globset] -version = "0.4.7" +version = "0.4.10" [dependencies.lazy_static] version = "1.1" @@ -52,10 +58,12 @@ version = "1" [dependencies.walkdir] version = "2.2.7" + [dev-dependencies.crossbeam-channel] version = "0.5.0" [features] simd-accel = ["globset/simd-accel"] + [target."cfg(windows)".dependencies.winapi-util] version = "0.1.2" diff --git a/vendor/ignore/src/default_types.rs b/vendor/ignore/src/default_types.rs index d4d7db35e..e6a3a8f37 100644 --- a/vendor/ignore/src/default_types.rs +++ b/vendor/ignore/src/default_types.rs @@ -16,18 +16,24 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("asciidoc", &["*.adoc", "*.asc", "*.asciidoc"]), ("asm", &["*.asm", "*.s", "*.S"]), ("asp", &[ - "*.aspx", "*.aspx.cs", "*.aspx.vb", "*.ascx", "*.ascx.cs", "*.ascx.vb", + "*.aspx", "*.aspx.cs", "*.aspx.vb", "*.ascx", "*.ascx.cs", + "*.ascx.vb", "*.asp" ]), ("ats", &["*.ats", "*.dats", "*.sats", "*.hats"]), ("avro", &["*.avdl", "*.avpr", "*.avsc"]), ("awk", &["*.awk"]), - ("bazel", &["*.bazel", "*.bzl", "*.BUILD", "*.bazelrc", "BUILD", "WORKSPACE"]), + ("bazel", &[ + "*.bazel", "*.bzl", "*.BUILD", "*.bazelrc", "BUILD", "MODULE.bazel", + "WORKSPACE", "WORKSPACE.bazel", + ]), ("bitbake", &["*.bb", "*.bbappend", "*.bbclass", "*.conf", "*.inc"]), ("brotli", &["*.br"]), ("buildstream", &["*.bst"]), ("bzip2", &["*.bz2", "*.tbz2"]), ("c", &["*.[chH]", "*.[chH].in", "*.cats"]), ("cabal", &["*.cabal"]), + ("candid", &["*.did"]), + ("carp", &["*.carp"]), ("cbor", &["*.cbor"]), ("ceylon", &["*.ceylon"]), ("clojure", &["*.clj", "*.cljc", "*.cljs", "*.cljx"]), @@ -40,18 +46,21 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ "*.[ChH].in", "*.cc.in", "*.[ch]pp.in", "*.[ch]xx.in", "*.hh.in", ]), ("creole", &["*.creole"]), - ("crystal", &["Projectfile", "*.cr"]), + ("crystal", &["Projectfile", "*.cr", "*.ecr", "shard.yml"]), ("cs", &["*.cs"]), ("csharp", &["*.cs"]), ("cshtml", &["*.cshtml"]), ("css", &["*.css", "*.scss"]), ("csv", &["*.csv"]), + ("cuda", &["*.cu", "*.cuh"]), ("cython", &["*.pyx", "*.pxi", "*.pxd"]), ("d", &["*.d"]), ("dart", &["*.dart"]), + ("devicetree", &["*.dts", "*.dtsi"]), ("dhall", &["*.dhall"]), ("diff", &["*.patch", "*.diff"]), ("docker", &["*Dockerfile*"]), + ("dts", &["*.dts", "*.dtsi"]), ("dvc", &["Dvcfile", "*.dvc"]), ("ebuild", &["*.ebuild"]), ("edn", &["*.edn"]), @@ -60,6 +69,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("elm", &["*.elm"]), ("erb", &["*.erb"]), ("erlang", &["*.erl", "*.hrl"]), + ("fennel", &["*.fnl"]), ("fidl", &["*.fidl"]), ("fish", &["*.fish"]), ("flatbuffers", &["*.fbs"]), @@ -68,24 +78,27 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ "*.f90", "*.F90", "*.f95", "*.F95", ]), ("fsharp", &["*.fs", "*.fsx", "*.fsi"]), - ("fut", &[".fut"]), + ("fut", &["*.fut"]), ("gap", &["*.g", "*.gap", "*.gi", "*.gd", "*.tst"]), ("gn", &["*.gn", "*.gni"]), ("go", &["*.go"]), ("gradle", &["*.gradle"]), ("groovy", &["*.groovy", "*.gradle"]), ("gzip", &["*.gz", "*.tgz"]), - ("h", &["*.h", "*.hpp"]), + ("h", &["*.h", "*.hh", "*.hpp"]), ("haml", &["*.haml"]), + ("hare", &["*.ha"]), ("haskell", &["*.hs", "*.lhs", "*.cpphs", "*.c2hs", "*.hsc"]), ("hbs", &["*.hbs"]), ("hs", &["*.hs", "*.lhs"]), ("html", &["*.htm", "*.html", "*.ejs"]), + ("hy", &["*.hy"]), ("idris", &["*.idr", "*.lidr"]), + ("janet", &["*.janet"]), ("java", &["*.java", "*.jsp", "*.jspx", "*.properties"]), ("jinja", &["*.j2", "*.jinja", "*.jinja2"]), ("jl", &["*.jl"]), - ("js", &["*.js", "*.jsx", "*.vue"]), + ("js", &["*.js", "*.jsx", "*.vue", "*.cjs", "*.mjs"]), ("json", &["*.json", "composer.lock"]), ("jsonl", &["*.jsonl"]), ("julia", &["*.jl"]), @@ -120,6 +133,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ "MPL-*[0-9]*", "OFL-*[0-9]*", ]), + ("lilypond", &["*.ly", "*.ily"]), ("lisp", &["*.el", "*.jl", "*.lisp", "*.lsp", "*.sc", "*.scm"]), ("lock", &["*.lock", "package-lock.json"]), ("log", &["*.log"]), @@ -135,14 +149,15 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ]), ("mako", &["*.mako", "*.mao"]), ("man", &["*.[0-9lnpx]", "*.[0-9][cEFMmpSx]"]), - ("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]), + ("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkd", "*.mkdn"]), ("matlab", &["*.m"]), - ("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]), + ("md", &["*.markdown", "*.md", "*.mdown", "*.mkd", "*.mkdn"]), ("meson", &["meson.build", "meson_options.txt"]), ("minified", &["*.min.html", "*.min.css", "*.min.js"]), ("mint", &["*.mint"]), ("mk", &["mkfile"]), ("ml", &["*.ml"]), + ("motoko", &["*.mo"]), ("msbuild", &[ "*.csproj", "*.fsproj", "*.vcxproj", "*.proj", "*.props", "*.targets", ]), @@ -152,16 +167,22 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("objcpp", &["*.h", "*.mm"]), ("ocaml", &["*.ml", "*.mli", "*.mll", "*.mly"]), ("org", &["*.org", "*.org_archive"]), + ("pants", &["BUILD"]), ("pascal", &["*.pas", "*.dpr", "*.lpr", "*.pp", "*.inc"]), ("pdf", &["*.pdf"]), ("perl", &["*.perl", "*.pl", "*.PL", "*.plh", "*.plx", "*.pm", "*.t"]), - ("php", &["*.php", "*.php3", "*.php4", "*.php5", "*.phtml"]), + ("php", &[ + // note that PHP 6 doesn't exist + // See: https://wiki.php.net/rfc/php6 + "*.php", "*.php3", "*.php4", "*.php5", "*.php7", "*.php8", + "*.pht", "*.phtml" + ]), ("po", &["*.po"]), ("pod", &["*.pod"]), ("postscript", &["*.eps", "*.ps"]), ("protobuf", &["*.proto"]), ("ps", &["*.cdxml", "*.ps1", "*.ps1xml", "*.psd1", "*.psm1"]), - ("puppet", &["*.erb", "*.pp", "*.rb"]), + ("puppet", &["*.epp", "*.erb", "*.pp", "*.rb"]), ("purs", &["*.purs"]), ("py", &["*.py"]), ("qmake", &["*.pro", "*.pri", "*.prf"]), @@ -170,7 +191,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("racket", &["*.rkt"]), ("rdoc", &["*.rdoc"]), ("readme", &["README*", "*README"]), + ("reasonml", &["*.re", "*.rei"]), ("red", &["*.r", "*.red", "*.reds"]), + ("rescript", &["*.res", "*.resi"]), ("robot", &["*.robot"]), ("rst", &["*.rst"]), ("ruby", &[ @@ -208,6 +231,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("slim", &["*.skim", "*.slim", "*.slime"]), ("smarty", &["*.tpl"]), ("sml", &["*.sml", "*.sig"]), + ("solidity", &["*.sol"]), ("soy", &["*.soy"]), ("spark", &["*.spark"]), ("spec", &["*.spec"]), @@ -225,11 +249,12 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("taskpaper", &["*.taskpaper"]), ("tcl", &["*.tcl"]), ("tex", &["*.tex", "*.ltx", "*.cls", "*.sty", "*.bib", "*.dtx", "*.ins"]), + ("texinfo", &["*.texi"]), ("textile", &["*.textile"]), ("tf", &["*.tf"]), ("thrift", &["*.thrift"]), ("toml", &["*.toml", "Cargo.lock"]), - ("ts", &["*.ts", "*.tsx"]), + ("ts", &["*.ts", "*.tsx", "*.cts", "*.mts"]), ("twig", &["*.twig"]), ("txt", &["*.txt"]), ("typoscript", &["*.typoscript", "*.ts"]), @@ -238,8 +263,12 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("vcl", &["*.vcl"]), ("verilog", &["*.v", "*.vh", "*.sv", "*.svh"]), ("vhdl", &["*.vhd", "*.vhdl"]), - ("vim", &["*.vim"]), - ("vimscript", &["*.vim"]), + ("vim", &[ + "*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc", + ]), + ("vimscript", &[ + "*.vim", ".vimrc", ".gvimrc", "vimrc", "gvimrc", "_vimrc", "_gvimrc", + ]), ("webidl", &["*.idl", "*.webidl", "*.widl"]), ("wiki", &["*.mediawiki", "*.wiki"]), ("xml", &[ @@ -262,3 +291,26 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ]), ("zstd", &["*.zst", "*.zstd"]), ]; + +#[cfg(test)] +mod tests { + use super::DEFAULT_TYPES; + + #[test] + fn default_types_are_sorted() { + let mut names = DEFAULT_TYPES.iter().map(|(name, _exts)| name); + + let Some(mut previous_name) = names.next() else { return; }; + + for name in names { + assert!( + name > previous_name, + r#""{}" should be sorted before "{}" in `DEFAULT_TYPES`"#, + name, + previous_name + ); + + previous_name = name; + } + } +} diff --git a/vendor/ignore/src/dir.rs b/vendor/ignore/src/dir.rs index 09414e9a6..2577665d5 100644 --- a/vendor/ignore/src/dir.rs +++ b/vendor/ignore/src/dir.rs @@ -202,11 +202,12 @@ impl Ignore { errs.maybe_push(err); igtmp.is_absolute_parent = true; igtmp.absolute_base = Some(absolute_base.clone()); - igtmp.has_git = if self.0.opts.git_ignore { - parent.join(".git").exists() - } else { - false - }; + igtmp.has_git = + if self.0.opts.require_git && self.0.opts.git_ignore { + parent.join(".git").exists() + } else { + false + }; ig = Ignore(Arc::new(igtmp)); compiled.insert(parent.as_os_str().to_os_string(), ig.clone()); } @@ -231,7 +232,9 @@ impl Ignore { /// Like add_child, but takes a full path and returns an IgnoreInner. fn add_child_path(&self, dir: &Path) -> (IgnoreInner, Option) { - let git_type = if self.0.opts.git_ignore || self.0.opts.git_exclude { + let git_type = if self.0.opts.require_git + && (self.0.opts.git_ignore || self.0.opts.git_exclude) + { dir.join(".git").metadata().ok().map(|md| md.file_type()) } else { None diff --git a/vendor/ignore/src/gitignore.rs b/vendor/ignore/src/gitignore.rs index 7922651cb..3c7ba5e6b 100644 --- a/vendor/ignore/src/gitignore.rs +++ b/vendor/ignore/src/gitignore.rs @@ -474,10 +474,13 @@ impl GitignoreBuilder { } // If it ends with a slash, then this should only match directories, // but the slash should otherwise not be used while globbing. - if let Some((i, c)) = line.char_indices().rev().nth(0) { - if c == '/' { - glob.is_only_dir = true; - line = &line[..i]; + if line.as_bytes().last() == Some(&b'/') { + glob.is_only_dir = true; + line = &line[..line.len() - 1]; + // If the slash was escaped, then remove the escape. + // See: https://github.com/BurntSushi/ripgrep/issues/2236 + if line.as_bytes().last() == Some(&b'\\') { + line = &line[..line.len() - 1]; } } glob.actual = line.to_string(); diff --git a/vendor/ignore/src/overrides.rs b/vendor/ignore/src/overrides.rs index d42d67ca2..e96b8e0b6 100644 --- a/vendor/ignore/src/overrides.rs +++ b/vendor/ignore/src/overrides.rs @@ -106,6 +106,7 @@ impl Override { } /// Builds a matcher for a set of glob overrides. +#[derive(Clone, Debug)] pub struct OverrideBuilder { builder: GitignoreBuilder, } diff --git a/vendor/ignore/src/types.rs b/vendor/ignore/src/types.rs index efb9a8d9b..616a8d217 100644 --- a/vendor/ignore/src/types.rs +++ b/vendor/ignore/src/types.rs @@ -122,10 +122,6 @@ enum GlobInner<'a> { Matched { /// The file type definition which provided the glob. def: &'a FileTypeDef, - /// The index of the glob that matched inside the file type definition. - which: usize, - /// Whether the selection was negated or not. - negated: bool, }, } @@ -291,13 +287,9 @@ impl Types { self.set.matches_into(name, &mut *matches); // The highest precedent match is the last one. if let Some(&i) = matches.last() { - let (isel, iglob) = self.glob_to_selection[i]; + let (isel, _) = self.glob_to_selection[i]; let sel = &self.selections[isel]; - let glob = Glob(GlobInner::Matched { - def: sel.inner(), - which: iglob, - negated: sel.is_negated(), - }); + let glob = Glob(GlobInner::Matched { def: sel.inner() }); return if sel.is_negated() { Match::Ignore(glob) } else { diff --git a/vendor/ignore/src/walk.rs b/vendor/ignore/src/walk.rs index b381197ef..602faaec3 100644 --- a/vendor/ignore/src/walk.rs +++ b/vendor/ignore/src/walk.rs @@ -941,7 +941,7 @@ impl Walk { // overheads; an example of this was a bespoke filesystem layer in // Windows that hosted files remotely and would download them on-demand // when particular filesystem operations occurred. Users of this system - // who ensured correct file-type fileters were being used could still + // who ensured correct file-type filters were being used could still // get unnecessary file access resulting in large downloads. if should_skip_entry(&self.ig, ent) { return Ok(true); @@ -1282,7 +1282,7 @@ impl WalkParallel { let quit_now = Arc::new(AtomicBool::new(false)); let num_pending = Arc::new(AtomicUsize::new(stack.lock().unwrap().len())); - crossbeam_utils::thread::scope(|s| { + std::thread::scope(|s| { let mut handles = vec![]; for _ in 0..threads { let worker = Worker { @@ -1296,13 +1296,12 @@ impl WalkParallel { skip: self.skip.clone(), filter: self.filter.clone(), }; - handles.push(s.spawn(|_| worker.run())); + handles.push(s.spawn(|| worker.run())); } for handle in handles { handle.join().unwrap(); } - }) - .unwrap(); // Pass along panics from threads + }); } fn threads(&self) -> usize { -- cgit v1.2.3