diff --git a/Cargo.lock b/Cargo.lock index a6fe354cb97..e43a165752f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,6 +115,15 @@ version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + [[package]] name = "arc-swap" version = "1.6.0" @@ -426,15 +435,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" @@ -647,9 +650,9 @@ checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -748,12 +751,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -866,6 +866,17 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.47", +] + [[package]] name = "diff" version = "0.1.13" @@ -882,6 +893,17 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.47", +] + [[package]] name = "document-features" version = "0.2.8" @@ -3353,6 +3375,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree-object-pool" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" + [[package]] name = "log" version = "0.4.21" @@ -3509,6 +3537,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.17" @@ -4378,6 +4412,12 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "slab" version = "0.4.9" @@ -4621,13 +4661,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", "libc", + "num-conv", "num_threads", "powerfmt", "serde", @@ -4643,10 +4684,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -5447,13 +5489,31 @@ checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zip" -version = "0.6.6" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +checksum = "1b7a5a9285bd4ee13bdeb3f8a4917eb46557e53f270c783849db8bef37b0ad00" dependencies = [ - "byteorder", + "arbitrary", "crc32fast", "crossbeam-utils", + "displaydoc", "flate2", + "indexmap", + "thiserror", "time", + "zopfli", +] + +[[package]] +name = "zopfli" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5019f391bac5cf252e93bbcc53d039ffd62c7bfb7c150414d61369afe57e946" +dependencies = [ + "bumpalo", + "crc32fast", + "lockfree-object-pool", + "log", + "once_cell", + "simd-adler32", ] diff --git a/gix-archive/Cargo.toml b/gix-archive/Cargo.toml index 81477eafc07..c08fc5a8264 100644 --- a/gix-archive/Cargo.toml +++ b/gix-archive/Cargo.toml @@ -31,7 +31,7 @@ gix-path = { version = "^0.10.7", path = "../gix-path", optional = true } gix-date = { version = "^0.8.6", path = "../gix-date" } flate2 = { version = "1.0.26", optional = true } -zip = { version = "0.6.6", optional = true, default-features = false, features = ["deflate", "time"] } +zip = { version = "1.3.1", optional = true, default-features = false, features = ["deflate", "time"] } time = { version = "0.3.23", optional = true, default-features = false, features = ["std"] } thiserror = "1.0.26" @@ -42,13 +42,13 @@ tar = { version = "0.4.38", optional = true } document-features = { version = "0.2.0", optional = true } [dev-dependencies] -gix-testtools = { path = "../tests/tools"} -gix-odb = { path = "../gix-odb"} -gix-worktree = { path = "../gix-worktree", default-features = false, features = ["attributes"]} -gix-hash = { path = "../gix-hash"} -gix-attributes = { path = "../gix-attributes"} -gix-object = { path = "../gix-object"} -gix-filter = { path = "../gix-filter"} +gix-testtools = { path = "../tests/tools" } +gix-odb = { path = "../gix-odb" } +gix-worktree = { path = "../gix-worktree", default-features = false, features = ["attributes"] } +gix-hash = { path = "../gix-hash" } +gix-attributes = { path = "../gix-attributes" } +gix-object = { path = "../gix-object" } +gix-filter = { path = "../gix-filter" } [package.metadata.docs.rs] all-features = true diff --git a/gix-archive/src/write.rs b/gix-archive/src/write.rs index 5c5dc885eca..244b40554e0 100644 --- a/gix-archive/src/write.rs +++ b/gix-archive/src/write.rs @@ -126,7 +126,7 @@ where NextFn: FnMut(&mut Stream) -> Result>, gix_worktree_stream::entry::Error>, { let compression_level = match opts.format { - Format::Zip { compression_level } => compression_level.map(|lvl| lvl as i32), + Format::Zip { compression_level } => compression_level.map(|lvl| lvl as i64), _other => return write_stream(stream, next_entry, out, opts), }; @@ -161,10 +161,10 @@ fn append_zip_entry( mut entry: gix_worktree_stream::Entry<'_>, buf: &mut Vec, mtime: zip::DateTime, - compression_level: Option, + compression_level: Option, tree_prefix: Option<&bstr::BString>, ) -> Result<(), Error> { - let file_opts = zip::write::FileOptions::default() + let file_opts = zip::write::FileOptions::<'_, ()>::default() .compression_method(zip::CompressionMethod::Deflated) .compression_level(compression_level) .large_file(entry.bytes_remaining().map_or(true, |len| len > u32::MAX as usize)) diff --git a/gix-archive/tests/archive.rs b/gix-archive/tests/archive.rs index a1b9920bb61..2b47fa14e8d 100644 --- a/gix-archive/tests/archive.rs +++ b/gix-archive/tests/archive.rs @@ -208,7 +208,7 @@ mod from_tree { ); let mut link = ar.by_name("prefix/symlink-to-a")?; assert!(!link.is_dir()); - assert!(link.is_file(), "no symlink differentiation"); + assert!(link.is_symlink(), "symlinks are supported as well"); assert_eq!( link.unix_mode(), Some(if cfg!(windows) { 0o100644 } else { 0o120644 }),