diff --git a/Cargo.lock b/Cargo.lock index 00dac9b1..dd88c84c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,10 +3,10 @@ version = 3 [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -552,15 +552,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "diff" version = "0.1.13" @@ -579,6 +570,17 @@ dependencies = [ "subtle", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "dyn-clone" version = "1.0.17" @@ -686,6 +688,9 @@ name = "faster-hex" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" +dependencies = [ + "serde", +] [[package]] name = "fastrand" @@ -717,9 +722,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "miniz_oxide", @@ -793,7 +798,7 @@ checksum = "ebb6549ddc63ba5722acb98c823b0eccb7f8b979407bd2a8fd616f581ae50982" dependencies = [ "bstr", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -823,32 +828,32 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.5" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" +checksum = "20018a1a6332e065f1fcc8305c1c932c6b8c9985edea2284b3c79dc6fa3ee4b2" dependencies = [ "bstr", "gix-date", "gix-utils", "itoa", - "thiserror", + "thiserror 2.0.12", "winnow", ] [[package]] name = "gix-chunk" -version = "0.4.8" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" +checksum = "0b1f1d8764958699dc764e3f727cef280ff4d1bd92c107bbf8acd85b30c1bd6f" dependencies = [ - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-command" -version = "0.3.6" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90009020dc4b3de47beed28e1334706e0a330ddd17f5cfeb097df3b15a54b77" +checksum = "cb410b84d6575db45e62025a9118bdbf4d4b099ce7575a76161e898d9ca98df1" dependencies = [ "bstr", "gix-path", @@ -858,36 +863,36 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.24.3" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78" +checksum = "a8da6591a7868fb2b6dabddea6b09988b0b05e0213f938dbaa11a03dd7a48d85" dependencies = [ "bstr", "gix-chunk", "gix-features", "gix-hash", "memmap2", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-config-value" -version = "0.14.6" +version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" +checksum = "8dc2c844c4cf141884678cabef736fd91dd73068b9146e6f004ba1a0457944b6" dependencies = [ "bitflags 2.5.0", "bstr", "gix-path", "libc", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-credentials" -version = "0.24.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c70146183bd3c7119329a3c7392d1aa0e0adbe48d727f4df31828fe6d8fdaa1" +checksum = "82a50c56b785c29a151ab4ccf74a83fe4e21d2feda0d30549504b4baed353e0a" dependencies = [ "bstr", "gix-command", @@ -897,38 +902,38 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-date" -version = "0.8.7" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" +checksum = "daa30058ec7d3511fbc229e4f9e696a35abd07ec5b82e635eff864a2726217e4" dependencies = [ "bstr", "itoa", - "thiserror", - "time", + "jiff", + "thiserror 2.0.12", ] [[package]] name = "gix-diff" -version = "0.44.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d" +checksum = "a8e92566eccbca205a0a0f96ffb0327c061e85bc5c95abbcddfe177498aa04f6" dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-features" -version = "0.38.2" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" +checksum = "7d85d673f2e022a340dba4713bed77ef2cf4cd737d2f3e0f159d45e0935fd81f" dependencies = [ "crc32fast", "flate2", @@ -938,15 +943,15 @@ dependencies = [ "libc", "prodash", "sha1_smol", - "thiserror", + "thiserror 2.0.12", "walkdir", ] [[package]] name = "gix-fs" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" +checksum = "3b3d4fac505a621f97e5ce2c69fdc425742af00c0920363ca4074f0eb48b1db9" dependencies = [ "fastrand", "gix-features", @@ -955,19 +960,19 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.14.2" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93d7df7366121b5018f947a04d37f034717e113dcf9ccd85c34b58e57a74d5e" +checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-hashtable" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" +checksum = "0ef65b256631078ef733bc5530c4e6b1c2e7d5c2830b75d4e9034ab3997d18fe" dependencies = [ "gix-hash", "hashbrown", @@ -975,49 +980,79 @@ dependencies = [ ] [[package]] -name = "gix-object" -version = "0.42.3" +name = "gix-lock" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" +checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror 2.0.12", +] + +[[package]] +name = "gix-negotiate" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" +dependencies = [ + "bitflags 2.5.0", + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-object", + "gix-revwalk", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "gix-object" +version = "0.46.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42d58010183ef033f31088479b4eb92b44fe341b35b62d39eb8b185573d77ea" dependencies = [ "bstr", "gix-actor", "gix-date", "gix-features", "gix-hash", + "gix-hashtable", + "gix-path", "gix-utils", "gix-validate", "itoa", "smallvec", - "thiserror", + "thiserror 2.0.12", "winnow", ] [[package]] name = "gix-odb" -version = "0.61.1" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b" +checksum = "cb780eceb3372ee204469478de02eaa34f6ba98247df0186337e0333de97d0ae" dependencies = [ "arc-swap", "gix-date", "gix-features", "gix-fs", "gix-hash", + "gix-hashtable", "gix-object", "gix-pack", "gix-path", "gix-quote", "parking_lot", "tempfile", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-pack" -version = "0.51.1" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229" +checksum = "4158928929be29cae7ab97afc8e820a932071a7f39d8ba388eed2380c12c566c" dependencies = [ "gix-chunk", "gix-diff", @@ -1031,81 +1066,139 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-packetline" -version = "0.17.5" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70486beda0903b6d5b65dfa6e40585098cdf4e6365ca2dff4f74c387354a515" +checksum = "123844a70cf4d5352441dc06bab0da8aef61be94ec239cb631e0ba01dc6d3a04" dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-path" -version = "0.10.11" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" +checksum = "f910668e2f6b2a55ff35a1f04df88a1a049f7b868507f4cbeeaa220eaba7be87" dependencies = [ "bstr", "gix-trace", "home", "once_cell", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-prompt" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5325eb17ce7b5e5d25dec5c2315d642a09d55b9888b3bf46b7d72e1621a55d8" +checksum = "79f2185958e1512b989a007509df8d61dca014aa759a22bee80cfa6c594c3b6d" dependencies = [ "gix-command", "gix-config-value", "parking_lot", "rustix", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-protocol" -version = "0.45.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed3bb6179835a3250403baa9d7022579e559fc45f2efc416d9de1a14b5acf11" +checksum = "c84642e8b6fed7035ce9cc449593019c55b0ec1af7a5dce1ab8a0636eaaeb067" dependencies = [ "bstr", "gix-credentials", "gix-date", "gix-features", "gix-hash", + "gix-lock", + "gix-negotiate", + "gix-object", + "gix-ref", + "gix-refspec", + "gix-revwalk", + "gix-shallow", + "gix-trace", "gix-transport", "gix-utils", "maybe-async", - "thiserror", + "thiserror 2.0.12", "winnow", ] [[package]] name = "gix-quote" -version = "0.4.12" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" +checksum = "e49357fccdb0c85c0d3a3292a9f6db32d9b3535959b5471bb9624908f4a066c6" dependencies = [ "bstr", "gix-utils", - "thiserror", + "thiserror 2.0.12", +] + +[[package]] +name = "gix-ref" +version = "0.49.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91b61776c839d0f1b7114901179afb0947aa7f4d30793ca1c56d335dfef485f" +dependencies = [ + "gix-actor", + "gix-features", + "gix-fs", + "gix-hash", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-utils", + "gix-validate", + "memmap2", + "thiserror 2.0.12", + "winnow", +] + +[[package]] +name = "gix-refspec" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00c056bb747868c7eb0aeb352c9f9181ab8ca3d0a2550f16470803500c6c413d" +dependencies = [ + "bstr", + "gix-hash", + "gix-revision", + "gix-validate", + "smallvec", + "thiserror 2.0.12", +] + +[[package]] +name = "gix-revision" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e1ddc474405a68d2ce8485705dd72fe6ce959f2f5fe718601ead5da2c8f9e7" +dependencies = [ + "bstr", + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-object", + "gix-revwalk", + "thiserror 2.0.12", ] [[package]] name = "gix-revwalk" -version = "0.13.2" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" +checksum = "510026fc32f456f8f067d8f37c34088b97a36b2229d88a6a5023ef179fcb109d" dependencies = [ "gix-commitgraph", "gix-date", @@ -1113,14 +1206,14 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-sec" -version = "0.10.6" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" +checksum = "47aeb0f13de9ef2f3033f5ff218de30f44db827ac9f1286f9ef050aacddd5888" dependencies = [ "bitflags 2.5.0", "gix-path", @@ -1129,10 +1222,22 @@ dependencies = [ ] [[package]] -name = "gix-tempfile" -version = "14.0.1" +name = "gix-shallow" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006acf5a613e0b5cf095d8e4b3f48c12a60d9062aa2b2dd105afaf8344a5600c" +checksum = "88d2673242e87492cb6ff671f0c01f689061ca306c4020f137197f3abc84ce01" +dependencies = [ + "bstr", + "gix-hash", + "gix-lock", + "thiserror 2.0.12", +] + +[[package]] +name = "gix-tempfile" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2feb86ef094cc77a4a9a5afbfe5de626897351bbbd0de3cb9314baf3049adb82" dependencies = [ "gix-fs", "libc", @@ -1149,9 +1254,9 @@ checksum = "7c396a2036920c69695f760a65e7f2677267ccf483f25046977d87e4cb2665f7" [[package]] name = "gix-transport" -version = "0.42.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2f783b2fe86bf2a8cf1f3b8669d65b01ab4932f32cc0101d3893e1b16a3bd6" +checksum = "dd04d91e507a8713cfa2318d5a85d75b36e53a40379cc7eb7634ce400ecacbaf" dependencies = [ "bstr", "gix-command", @@ -1160,14 +1265,14 @@ dependencies = [ "gix-quote", "gix-sec", "gix-url", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-traverse" -version = "0.39.2" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" +checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" dependencies = [ "bitflags 2.5.0", "gix-commitgraph", @@ -1177,28 +1282,28 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror", + "thiserror 2.0.12", ] [[package]] name = "gix-url" -version = "0.27.3" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db829ebdca6180fbe32be7aed393591df6db4a72dbbc0b8369162390954d1cf" +checksum = "d096fb733ba6bd3f5403dba8bd72bdd8809fe2b347b57844040b8f49c93492d9" dependencies = [ "bstr", "gix-features", "gix-path", - "home", - "thiserror", + "percent-encoding", + "thiserror 2.0.12", "url", ] [[package]] name = "gix-utils" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +checksum = "ff08f24e03ac8916c478c8419d7d3c33393da9bb41fa4c24455d5406aeefd35f" dependencies = [ "fastrand", "unicode-normalization", @@ -1206,12 +1311,12 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" +checksum = "34b5f1253109da6c79ed7cf6e1e38437080bb6d704c76af14c93e2f255234084" dependencies = [ "bstr", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -1273,13 +1378,142 @@ dependencies = [ ] [[package]] -name = "idna" -version = "0.5.0" +name = "icu_collections" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1337,6 +1571,35 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jiff" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3590fea8e9e22d449600c9bbd481a8163bef223e4ff938e5f55899f8cf1adb93" +dependencies = [ + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde", + "windows-sys 0.52.0", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1283705eb0a21404d2bfd6eef2a7593d240bc42a0bdb39db0ad6fa2ec026524" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + [[package]] name = "jobserver" version = "0.1.31" @@ -1432,6 +1695,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + [[package]] name = "localtime" version = "1.3.1" @@ -1485,11 +1754,11 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -1575,12 +1844,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -1611,15 +1874,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - [[package]] name = "numtoa" version = "0.1.0" @@ -1802,10 +2056,19 @@ dependencies = [ ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "portable-atomic" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] [[package]] name = "ppv-lite86" @@ -1867,9 +2130,13 @@ dependencies = [ [[package]] name = "prodash" -version = "28.0.0" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" +checksum = "f04bb108f648884c23b98a0e940ebc2c93c0c3b89f04dbaf7eb8256ce617d1bc" +dependencies = [ + "log", + "parking_lot", +] [[package]] name = "qcheck" @@ -1931,7 +2198,7 @@ dependencies = [ "siphasher 1.0.1", "sqlite", "tempfile", - "thiserror", + "thiserror 1.0.69", "unicode-normalization", ] @@ -1959,7 +2226,7 @@ dependencies = [ "serde_json", "shlex", "tempfile", - "thiserror", + "thiserror 1.0.69", "timeago", "tree-sitter", "tree-sitter-bash", @@ -1988,7 +2255,7 @@ dependencies = [ "radicle", "shlex", "snapbox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2008,7 +2275,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2022,7 +2289,7 @@ dependencies = [ "radicle-crypto", "serde", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2042,7 +2309,7 @@ dependencies = [ "sqlite", "ssh-key", "tempfile", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2059,7 +2326,6 @@ version = "0.10.0" dependencies = [ "bstr", "either", - "gix-actor", "gix-features", "gix-hash", "gix-odb", @@ -2070,7 +2336,7 @@ dependencies = [ "nonempty 0.9.0", "radicle", "radicle-git-ext", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2084,7 +2350,7 @@ dependencies = [ "percent-encoding", "radicle-std-ext", "serde", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2123,7 +2389,7 @@ dependencies = [ "socket2", "sqlite", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2135,7 +2401,7 @@ dependencies = [ "radicle-cli", "radicle-crypto", "radicle-git-ext", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2153,7 +2419,7 @@ version = "0.9.0" dependencies = [ "byteorder", "log", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -2178,7 +2444,7 @@ dependencies = [ "radicle-git-ext", "radicle-std-ext", "tar", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -2202,7 +2468,7 @@ dependencies = [ "shlex", "tempfile", "termion 3.0.0", - "thiserror", + "thiserror 1.0.69", "unicode-display-width", "unicode-segmentation", "zeroize", @@ -2406,18 +2672,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.198" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -2664,6 +2930,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "streaming-iterator" version = "0.1.9" @@ -2698,6 +2970,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "tar" version = "0.4.40" @@ -2751,7 +3034,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", ] [[package]] @@ -2766,36 +3058,14 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.3.36" +name = "thiserror-impl" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -2804,6 +3074,16 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1710e589de0a76aaf295cd47a6699f6405737dbfd3cf2b75c92d000b548d0e6" +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2881,7 +3161,7 @@ dependencies = [ "lazy_static", "regex", "streaming-iterator", - "thiserror", + "thiserror 1.0.69", "tree-sitter", ] @@ -2977,12 +3257,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-display-width" version = "0.3.0" @@ -3031,15 +3305,27 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -3287,13 +3573,25 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -3311,8 +3609,75 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] diff --git a/deny.toml b/deny.toml index 9688d57a..d4618c15 100644 --- a/deny.toml +++ b/deny.toml @@ -47,6 +47,7 @@ version = 2 allow = [ "MIT", "Apache-2.0", + "Unlicense", "Unicode-DFS-2016", "Unicode-3.0", "BSD-3-Clause", diff --git a/radicle-fetch/Cargo.toml b/radicle-fetch/Cargo.toml index 5382e995..171dd25a 100644 --- a/radicle-fetch/Cargo.toml +++ b/radicle-fetch/Cargo.toml @@ -10,13 +10,12 @@ edition = "2021" [dependencies] bstr = { version = "1.3" } either = { version = "1.9.0" } -gix-actor = { version = "0.31.1" } -gix-features = { version = "0.38.1", features = ["progress"] } -gix-hash = { version = "0.14.2" } -gix-odb = { version = "0.61.0" } -gix-pack = { version = "0.51.0" } -gix-protocol = { version = "0.45", features = ["blocking-client"] } -gix-transport = { version = "0.42", features = ["blocking-client"] } +gix-features = { version = "0.39.1", features = ["progress"] } +gix-hash = { version = "0.15.1" } +gix-odb = { version = "0.66.0" } +gix-pack = { version = "0.56.0" } +gix-protocol = { version = "0.47.0", features = ["blocking-client"] } +gix-transport = { version = "0.44.0", features = ["blocking-client"] } log = { version = "0.4.17", features = ["std"] } nonempty = { version = "0.9.0" } radicle-git-ext = { version = "0.8.0", features = ["bstr"] } diff --git a/radicle-fetch/src/transport.rs b/radicle-fetch/src/transport.rs index 9b08f79e..eeaa3bc4 100644 --- a/radicle-fetch/src/transport.rs +++ b/radicle-fetch/src/transport.rs @@ -10,9 +10,7 @@ use std::sync::Arc; use bstr::BString; use gix_features::progress::prodash::progress; use gix_protocol::handshake; -use gix_protocol::FetchConnection; use gix_transport::client; -use gix_transport::client::TransportWithoutIO as _; use gix_transport::Protocol; use gix_transport::Service; use radicle::git::Oid; @@ -85,7 +83,7 @@ where log::trace!(target: "fetch", "Performing handshake for {}", self.repo); let (read, write) = self.stream.open().map_err(io_other)?; gix_protocol::fetch::handshake( - &mut Connection::new(read, write, FetchConnection::AllowReuse, self.repo.clone()), + &mut Connection::new(read, write, self.repo.clone()), |_| Ok(None), vec![], &mut progress::Discard, @@ -105,11 +103,10 @@ where ls_refs::run( ls_refs::Config { prefixes, - extra_params: vec![], repo: self.repo.clone(), }, handshake, - Connection::new(read, write, FetchConnection::AllowReuse, self.repo.clone()), + Connection::new(read, write, self.repo.clone()), &mut progress::Discard, ) .map_err(io_other) @@ -137,7 +134,7 @@ where interrupt, }, handshake, - Connection::new(read, write, FetchConnection::AllowReuse, self.repo.clone()), + Connection::new(read, write, self.repo.clone()), &mut progress::Discard, ) .map_err(io_other)? @@ -184,7 +181,6 @@ where pub(crate) struct Connection { inner: client::git::Connection, - mode: FetchConnection, } impl Connection @@ -192,7 +188,7 @@ where R: io::Read, W: io::Write, { - pub fn new(read: R, write: W, mode: FetchConnection, repo: BString) -> Self { + pub fn new(read: R, write: W, repo: BString) -> Self { Self { inner: client::git::Connection::new( read, @@ -203,7 +199,6 @@ where client::git::ConnectMode::Daemon, false, ), - mode, } } } @@ -256,20 +251,6 @@ where } } -fn indicate_end_of_interaction(transport: &mut Connection) -> Result<(), client::Error> -where - R: io::Read, - W: io::Write, -{ - // An empty request marks the (early) end of the interaction. Only relevant in stateful transports though. - if transport.connection_persists_across_multiple_requests() { - transport - .request(client::WriteMode::Binary, client::MessageKind::Flush, false)? - .into_read()?; - } - Ok(()) -} - fn io_other(err: impl std::error::Error + Send + Sync + 'static) -> io::Error { io::Error::new(io::ErrorKind::Other, err) } diff --git a/radicle-fetch/src/transport/fetch.rs b/radicle-fetch/src/transport/fetch.rs index f45ba045..3fdffaf4 100644 --- a/radicle-fetch/src/transport/fetch.rs +++ b/radicle-fetch/src/transport/fetch.rs @@ -1,27 +1,19 @@ -use std::borrow::Cow; use std::io; -use std::io::BufRead; use std::path::PathBuf; use std::sync::{atomic::AtomicBool, Arc}; -use gix_features::progress::NestedProgress; +use gix_features::progress::{DynNestedProgress, NestedProgress}; use gix_pack as pack; use gix_protocol::fetch; -use gix_protocol::fetch::{Delegate, DelegateBlocking}; +use gix_protocol::fetch::negotiate::one_round::State; use gix_protocol::handshake; use gix_protocol::handshake::Ref; -use gix_protocol::ls_refs; -use gix_protocol::FetchConnection; -use gix_transport::bstr::BString; -use gix_transport::client; -use gix_transport::client::{ExtendedBufRead, MessageKind}; -use gix_transport::Protocol; -use crate::git::packfile; +use crate::git::{oid, packfile}; -use super::{agent_name, indicate_end_of_interaction, Connection, WantsHaves}; +use super::{agent_name, Connection, WantsHaves}; -pub type Error = gix_protocol::fetch::Error; +pub type Error = fetch::Error; pub mod error { use std::io; @@ -50,15 +42,11 @@ pub struct PackWriter { impl PackWriter { /// Write the packfile read from `pack` to the `objects/pack` /// directory. - pub fn write_pack

( + pub fn write_pack( &self, - mut pack: impl BufRead, - mut progress: P, - ) -> Result - where - P: NestedProgress, - P::SubProgress: 'static, - { + pack: &mut dyn std::io::BufRead, + progress: &mut dyn DynNestedProgress, + ) -> Result { let options = pack::bundle::write::Options { // N.b. use all cores. Can make configurable if needed // later. @@ -80,9 +68,9 @@ impl PackWriter { )?); let thickener = thickener.to_handle_arc(); Ok(pack::Bundle::write_to_directory( - &mut pack, + pack, Some(&self.git_dir.join("objects").join("pack")), - &mut progress, + progress, &self.interrupt, Some(thickener), options, @@ -92,10 +80,8 @@ impl PackWriter { /// The fetch [`Delegate`] that negotiates the fetch with the /// server-side. -pub struct Fetch { +pub struct Negotiate { wants_haves: WantsHaves, - pack_writer: PackWriter, - out: FetchOut, } /// The result of running a fetch via [`run`]. @@ -108,74 +94,50 @@ pub struct FetchOut { // FIXME: the delegate pattern will be removed in the near future and // we should look at the fetch code being used in gix to see how we // can migrate to the proper form of fetching. -impl Delegate for &mut Fetch { - fn receive_pack( +impl fetch::Negotiate for Negotiate { + fn mark_complete_and_common_ref( &mut self, - input: impl io::BufRead, - progress: impl NestedProgress + 'static, - _refs: &[handshake::Ref], - previous_response: &fetch::Response, - ) -> io::Result<()> { - self.out - .refs - .extend(previous_response.wanted_refs().iter().map( - |fetch::response::WantedRef { id, path }| Ref::Direct { - full_ref_name: path.clone(), - object: *id, - }, - )); - let pack = self - .pack_writer - .write_pack(input, progress) - .map_err(|err| io::Error::new(io::ErrorKind::Other, err))?; - self.out.keepfile = pack.keep_path.as_ref().and_then(packfile::Keepfile::new); - self.out.pack = Some(pack); - Ok(()) + ) -> Result { + Ok(fetch::negotiate::Action::MustNegotiate { + remote_ref_target_known: vec![], + }) } -} -impl DelegateBlocking for &mut Fetch { - fn negotiate( + fn add_wants( &mut self, - _refs: &[handshake::Ref], arguments: &mut fetch::Arguments, - _previous_response: Option<&fetch::Response>, - ) -> io::Result { - use crate::git::oid; - + _remote_ref_target_known: &[bool], + ) -> bool { + let mut has_want = false; for oid in &self.wants_haves.wants { arguments.want(oid::to_object_id(*oid)); + has_want = true; } + has_want + } + /// We don't actually negotiate, just provides all our haves and wants, while telling the + /// server to make the best of it and just send a pack. + /// Real Git negotiation can be done with calls to [`fetch::negotiate::one_round()`], but that + /// requires a [`fetch::RefMap`] which can be instantiated with refspecs. + fn one_round( + &mut self, + _state: &mut State, + arguments: &mut fetch::Arguments, + _previous_response: Option<&fetch::Response>, + ) -> Result<(fetch::negotiate::Round, bool), fetch::negotiate::Error> { for oid in &self.wants_haves.haves { arguments.have(oid::to_object_id(*oid)); } - // N.b. sends `done` packet - Ok(fetch::Action::Cancel) - } - - fn prepare_ls_refs( - &mut self, - _server: &client::Capabilities, - _arguments: &mut Vec, - _features: &mut Vec<(&str, Option>)>, - ) -> io::Result { - // N.b. we performed ls-refs before the fetch already. - Ok(ls_refs::Action::Skip) - } - - fn prepare_fetch( - &mut self, - _version: Protocol, - _server: &client::Capabilities, - _features: &mut Vec<(&str, Option>)>, - _refs: &[handshake::Ref], - ) -> io::Result { - if self.wants_haves.wants.is_empty() { - return Err(io::Error::new(io::ErrorKind::InvalidData, "empty fetch")); - } - Ok(fetch::Action::Continue) + let round = fetch::negotiate::Round { + haves_sent: self.wants_haves.haves.len(), + in_vain: 0, + haves_to_send: 0, + previous_response_had_at_least_one_in_common: false, + }; + let is_done = true; + Ok((round, is_done)) } } @@ -200,115 +162,59 @@ where { log::trace!(target: "fetch", "Performing fetch"); - let mut delegate = Fetch { - wants_haves, - pack_writer, - out: FetchOut { - refs: Vec::new(), - pack: None, - keepfile: None, - }, + if wants_haves.wants.is_empty() { + return Err(Error::ReadRemainingBytes(io::Error::new( + io::ErrorKind::InvalidData, + "empty fetch", + ))); + } + let mut out = FetchOut { + refs: Vec::new(), + pack: None, + keepfile: None, }; + let mut negotiate = Negotiate { wants_haves }; + let agent = agent_name().map_err(Error::ReadRemainingBytes)?; - let handshake::Outcome { - server_protocol_version: protocol, - refs: _refs, - capabilities, - } = handshake; - let agent = agent_name()?; - let fetch = gix_protocol::Command::Fetch; + let mut pack_out = None; + let mut handshake = handshake.clone(); + let fetch_out = gix_protocol::fetch( + &mut negotiate, + |read_pack, progress, _should_interrupt| -> Result<_, error::PackWriter> { + let res = pack_writer.write_pack(read_pack, progress)?; + pack_out = Some(res); + Ok(true) + }, + progress, + &pack_writer.interrupt, + fetch::Context { + handshake: &mut handshake, + transport: &mut conn, + user_agent: ("agent", Some(agent.into())), + trace_packetlines: false, + }, + fetch::Options { + shallow_file: "no shallow file required as we reject shallow remotes (and we aren't shallow ourselves)".into(), + reject_shallow_remote: true, + shallow: &fetch::Shallow::NoChange, + tags: fetch::Tags::None, + }, + )?.expect("we always get a pack"); - let mut features = fetch.default_features(*protocol, capabilities); - match (&mut delegate).prepare_fetch(*protocol, capabilities, &mut features, &[]) { - Ok(fetch::Action::Continue) => { - // FIXME: this is a private function in gitoxide - // fetch.validate_argument_prefixes_or_panic(protocol, &capabilities, &[], &features) - } - // N.b. we always return Action::Continue - Ok(fetch::Action::Cancel) => unreachable!(), - Err(err) => { - indicate_end_of_interaction(&mut conn)?; - return Err(err.into()); - } - } + out.refs + .extend(fetch_out.last_response.wanted_refs().iter().map( + |fetch::response::WantedRef { id, path }| Ref::Direct { + full_ref_name: path.clone(), + object: *id, + }, + )); + let pack_out = pack_out.expect("we always get a pack"); + out.keepfile = pack_out + .keep_path + .as_ref() + .and_then(packfile::Keepfile::new); + out.pack = Some(pack_out); - gix_protocol::fetch::Response::check_required_features(*protocol, &features)?; - let sideband_all = features.iter().any(|(n, _)| *n == "sideband-all"); - features.push(("agent", Some(Cow::Owned(agent)))); - let mut args = fetch::Arguments::new(*protocol, features, false); - - let mut previous_response = None::; - let mut round = 1; - 'negotiation: loop { - progress.step(); - progress.set_name(format!("negotiate (round {round})")); - round += 1; - let action = (&mut delegate).negotiate(&[], &mut args, previous_response.as_ref())?; - let mut reader = args.send(&mut conn, action == fetch::Action::Cancel)?; - if sideband_all { - setup_remote_progress(progress, &mut reader); - } - let response = fetch::Response::from_line_reader(*protocol, &mut reader, true, false)?; - previous_response = if response.has_pack() { - progress.step(); - if !sideband_all { - setup_remote_progress(progress, &mut reader); - } - let timer = std::time::Instant::now(); - // TODO: remove delegate in favor of functional style to fix progress-hack, - // needed as it needs `'static`. As the top-level seems to pass `Discard`, - // there should be no repercussions right now. - (&mut delegate).receive_pack( - &mut reader, - progress.add_child("receiving pack"), - &[], - &response, - )?; - log::trace!(target: "fetch", "Received pack ({}ms)", timer.elapsed().as_millis()); - assert_eq!( - reader.stopped_at(), - None, - "packs are read without 'overshooting', hence it never encountered EOF" - ); - // Consume anything that might still be left on the wire - this is 'EOF' most of the time, - // but some tests have 'garbage' here as well. - std::io::copy(&mut reader, &mut std::io::sink())?; - assert_eq!( - reader.stopped_at(), - Some(MessageKind::Flush), - "the flush packet was now consumed" - ); - break 'negotiation; - } else { - match action { - fetch::Action::Cancel => break 'negotiation, - fetch::Action::Continue => Some(response), - } - } - } - if matches!(protocol, Protocol::V2) - && matches!(conn.mode, FetchConnection::TerminateOnSuccessfulCompletion) - { - log::trace!(target: "fetch", "Indicating end of interaction"); - indicate_end_of_interaction(&mut conn)?; - } - - log::trace!(target: "fetch", "fetched refs: {:?}", delegate.out.refs); - Ok(delegate.out) -} - -fn setup_remote_progress<'a, P>( - progress: &mut P, - reader: &mut Box + Unpin + 'a>, -) where - P: NestedProgress, - P::SubProgress: 'static, -{ - reader.set_progress_handler(Some(Box::new({ - let mut remote_progress = progress.add_child("remote"); - move |is_err: bool, data: &[u8]| { - gix_protocol::RemoteProgress::translate_to_progress(is_err, data, &mut remote_progress); - gix_transport::packetline::read::ProgressAction::Continue - } - }) as gix_transport::client::HandleProgress<'a>)); + log::trace!(target: "fetch", "fetched refs: {:?}", out.refs); + Ok(out) } diff --git a/radicle-fetch/src/transport/ls_refs.rs b/radicle-fetch/src/transport/ls_refs.rs index 3151c646..5a25d735 100644 --- a/radicle-fetch/src/transport/ls_refs.rs +++ b/radicle-fetch/src/transport/ls_refs.rs @@ -1,16 +1,13 @@ use std::borrow::Cow; -use std::io::{self, BufRead}; +use std::io; -use bstr::ByteSlice; use gix_features::progress::Progress; -use gix_protocol::fetch::{self, Delegate, DelegateBlocking}; use gix_protocol::handshake::{self, Ref}; +use gix_protocol::ls_refs; use gix_protocol::transport::Protocol; -use gix_protocol::{ls_refs, Command}; use gix_transport::bstr::{BString, ByteVec}; -use gix_transport::client::{self, TransportV2Ext}; -use super::{agent_name, indicate_end_of_interaction, Connection}; +use super::{agent_name, Connection}; /// Configuration for running an ls-refs process. /// @@ -19,84 +16,10 @@ pub struct Config { /// The repository name, i.e. `/`. #[allow(dead_code)] pub repo: BString, - /// Extra parameters to pass to the ls-refs process. - pub extra_params: Vec<(String, Option)>, /// Ref prefixes for filtering the output of the ls-refs process. pub prefixes: Vec, } -/// The Gitoxide delegate for running the ls-refs process. -struct LsRefs { - /// Configuration for the ls-refs process. - config: Config, - /// The resulting references returned by the ls-refs process. - refs: Vec, -} - -impl LsRefs { - fn new(config: Config) -> Self { - Self { - config, - refs: Vec::new(), - } - } -} - -// FIXME: the delegate pattern will be removed in the near future and -// we should look at the fetch code being used in gix to see how we -// can migrate to the proper form of fetching. -impl DelegateBlocking for LsRefs { - fn handshake_extra_parameters(&self) -> Vec<(String, Option)> { - self.config.extra_params.clone() - } - - fn prepare_ls_refs( - &mut self, - _caps: &client::Capabilities, - args: &mut Vec, - _: &mut Vec<(&str, Option>)>, - ) -> io::Result { - for prefix in &self.config.prefixes { - let mut arg = BString::from("ref-prefix "); - arg.push_str(prefix); - args.push(arg) - } - Ok(ls_refs::Action::Continue) - } - - fn prepare_fetch( - &mut self, - _: Protocol, - _: &client::Capabilities, - _: &mut Vec<(&str, Option>)>, - refs: &[Ref], - ) -> io::Result { - self.refs.extend_from_slice(refs); - Ok(fetch::Action::Cancel) - } - - fn negotiate( - &mut self, - _: &[Ref], - _: &mut fetch::Arguments, - _: Option<&fetch::Response>, - ) -> io::Result { - unreachable!("`negotiate` called even though no `fetch` command was sent") - } -} - -impl Delegate for LsRefs { - fn receive_pack( - &mut self, - _: impl BufRead, - _: impl Progress, - _: &[Ref], - _: &fetch::Response, - ) -> io::Result<()> { - unreachable!("`receive_pack` called even though no `fetch` command was sent") - } -} - /// Run the ls-refs process using the provided `config`. /// /// It is expected that the `handshake` was run outside of this @@ -116,7 +39,6 @@ where W: io::Write, { log::trace!(target: "fetch", "Performing ls-refs: {:?}", config.prefixes); - let mut delegate = LsRefs::new(config); let handshake::Outcome { server_protocol_version: protocol, capabilities, @@ -130,48 +52,21 @@ where ))); } - let ls = Command::LsRefs; - let mut features = ls.default_features(Protocol::V2, capabilities); - // N.b. copied from gitoxide - let mut args = vec![ - b"symrefs".as_bstr().to_owned(), - b"peel".as_bstr().to_owned(), - ]; - if capabilities - .capability("ls-refs") - .and_then(|cap| cap.supports("unborn")) - .unwrap_or_default() - { - args.push("unborn".into()); - } - let refs = match delegate.prepare_ls_refs(capabilities, &mut args, &mut features) { - Ok(ls_refs::Action::Skip) => Vec::new(), - Ok(ls_refs::Action::Continue) => { - // FIXME: this is a private function - // ls.validate_argument_prefixes_or_panic(Protocol::V2, capabilities, &args, &features); - - let agent = agent_name()?; - features.push(("agent", Some(Cow::Owned(agent)))); - - progress.step(); - progress.set_name("list refs".into()); - let mut remote_refs = conn.invoke( - ls.as_str(), - features.clone().into_iter(), - if args.is_empty() { - None - } else { - Some(args.into_iter()) - }, - false, - )?; - handshake::refs::from_v2_refs(&mut remote_refs)? - } - Err(err) => { - indicate_end_of_interaction(&mut conn)?; - return Err(err.into()); - } - }; + let refs = gix_protocol::ls_refs( + &mut conn, + capabilities, + |_caps, args, features| { + for prefix in &config.prefixes { + let mut arg = BString::from("ref-prefix "); + arg.push_str(prefix); + args.push(arg) + } + features.push(("agent", Some(Cow::Owned(agent_name()?)))); + Ok(gix_protocol::ls_refs::Action::Continue) + }, + progress, + false, /* trace packetlines */ + )?; Ok(refs) }