Apply upstream tree_magic_mini patch to fix blank line crash

Fixes #378
shared_unique
Wilfred Hughes 2022-10-31 00:54:24 +07:00
parent 7f7b35441b
commit b662a2220b
3 changed files with 10 additions and 4 deletions

@ -7,6 +7,9 @@ better results when difftastic doesn't fully support the syntax
(e.g. PostCSS is a superset of CSS) or when there are actual syntax (e.g. PostCSS is a superset of CSS) or when there are actual syntax
errors. errors.
Fixed a crash on file content detection when the local MIME database
contains blank lines.
### Display ### Display
Line numbers styling has been tweaked to make it more visually Line numbers styling has been tweaked to make it more visually

5
Cargo.lock generated

@ -637,9 +637,8 @@ dependencies = [
[[package]] [[package]]
name = "tree_magic_mini" name = "tree_magic_mini"
version = "3.0.3" version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "git+https://github.com/Wilfred/tree_magic?branch=fix-panic-for-empty-strings#13dd6dda15c7062bd8f7dd5bc9bb5b16ce9ee613"
checksum = "91adfd0607cacf6e4babdb870e9bec4037c1c4b151cfd279ccefc5e0c7feaa6d"
dependencies = [ dependencies = [
"bytecount", "bytecount",
"fnv", "fnv",

@ -44,7 +44,7 @@ const_format = "0.2.22"
owo-colors = "3.3.0" owo-colors = "3.3.0"
wu-diff = "0.1.2" wu-diff = "0.1.2"
rayon = "1.5.2" rayon = "1.5.2"
tree_magic_mini = "3.0.3" tree_magic_mini = "3.0.2"
bumpalo = "3.9.1" bumpalo = "3.9.1"
unicode-width = "0.1.9" unicode-width = "0.1.9"
term_size = "0.3.2" term_size = "0.3.2"
@ -65,3 +65,7 @@ name = "difft"
path = "src/main.rs" path = "src/main.rs"
[features] [features]
[patch.crates-io]
# https://github.com/mbrubeck/tree_magic/pull/13 hasn't been merged yet.
tree_magic_mini = { git = 'https://github.com/Wilfred/tree_magic', branch = 'fix-panic-for-empty-strings' }