From c23a457e72abe608715ac76f076f47dc42af07a5 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:44 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-odb/.cargo-checksum.json | 2 +- vendor/gix-odb/CHANGELOG.md | 311 ++++++++++++++++++++- vendor/gix-odb/Cargo.toml | 46 +-- vendor/gix-odb/src/alternate/mod.rs | 15 +- vendor/gix-odb/src/cache.rs | 38 +-- vendor/gix-odb/src/find.rs | 14 +- vendor/gix-odb/src/lib.rs | 15 +- vendor/gix-odb/src/sink.rs | 14 +- vendor/gix-odb/src/store_impls/dynamic/find.rs | 54 ++-- vendor/gix-odb/src/store_impls/dynamic/handle.rs | 7 +- vendor/gix-odb/src/store_impls/dynamic/header.rs | 18 +- vendor/gix-odb/src/store_impls/dynamic/init.rs | 10 +- vendor/gix-odb/src/store_impls/dynamic/iter.rs | 2 +- .../gix-odb/src/store_impls/dynamic/load_index.rs | 10 +- vendor/gix-odb/src/store_impls/dynamic/mod.rs | 2 + vendor/gix-odb/src/store_impls/dynamic/prefix.rs | 5 +- .../gix-odb/src/store_impls/dynamic/structure.rs | 1 + vendor/gix-odb/src/store_impls/dynamic/types.rs | 2 +- vendor/gix-odb/src/store_impls/dynamic/verify.rs | 225 +++++++-------- vendor/gix-odb/src/store_impls/dynamic/write.rs | 7 +- vendor/gix-odb/src/store_impls/loose/find.rs | 18 +- vendor/gix-odb/src/store_impls/loose/verify.rs | 8 +- vendor/gix-odb/src/store_impls/loose/write.rs | 36 +-- vendor/gix-odb/src/traits.rs | 104 +++---- 24 files changed, 616 insertions(+), 348 deletions(-) (limited to 'vendor/gix-odb') diff --git a/vendor/gix-odb/.cargo-checksum.json b/vendor/gix-odb/.cargo-checksum.json index b2e3548a0..6c557413d 100644 --- a/vendor/gix-odb/.cargo-checksum.json +++ b/vendor/gix-odb/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"817f02df2800ee368c7fb1514ad45513f59cf8f0868e6e349f017f2519b1cf21","Cargo.toml":"2ea37c0f384769d47365514c86be9624551f6c0f179a4f0fef7e53830a52470f","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/alternate/mod.rs":"02d29b6fbc6f4801a657882e19c01fa4aa7e7fd0f10dd25c8c040412468bb1de","src/alternate/parse.rs":"418f5c54d6293ceb886d44a3482dd3a2378d50031ff04186541c5e09be2eedcc","src/cache.rs":"b33c52a0ee7370ad9e81aed40cf74a9df8b60228edf0f2ea765112a7be130b9c","src/find.rs":"270a843d766f9f1641884c173d820c34ed8c59fa4dd6bce04f465b51888433d5","src/lib.rs":"b9471cf9bdac276de683053c2e990766e95453fe6ba568b7bac8f290b1ea24e1","src/sink.rs":"812541c306c27d036bfd3f90bcc9b620992c18ae49fc808ee7c86a7bde98ab20","src/store_impls/dynamic/access.rs":"524b85c6f523f24ba6c0a2abc5cb9555b535dd5d1ce4d42beedd2aae28e6d938","src/store_impls/dynamic/find.rs":"dcf75e92f08caead7019dccbf378037ddb84ebaac0b628247c6d9e6c27eae460","src/store_impls/dynamic/handle.rs":"fd203474b9097f19ab2ddabece78ed8abcb1a3e014475d814f8ff8da6ce42a07","src/store_impls/dynamic/header.rs":"a2014baa8be53d160eff1c2ff79d6d88353de4cdf9cd2c15b031e8d05d5f8ef3","src/store_impls/dynamic/init.rs":"d0b87c762069f5eb831d29646be0bf3d733a431c3f725baf843beda94e925591","src/store_impls/dynamic/iter.rs":"bed742ace9aaee98aeccf6a8d498372f908fcbcc8649d6c7f0c2c96029a21fa8","src/store_impls/dynamic/load_index.rs":"3e280d9e308dd668d2d4d23dc68e815c82d3cb7b17d0fd5fb08d111e221c42ad","src/store_impls/dynamic/load_one.rs":"fa0393f14a653d9116c7b470219175cccffa8bb2e981afc89d62a48778a6d825","src/store_impls/dynamic/metrics.rs":"ab54a9986a58e72301ed9a85155572e7a8e0df977177dc51491fc776883c4200","src/store_impls/dynamic/mod.rs":"6280f692d8bf3f982e63068d458472f53cf4126e6a7d7e4dae620bd6bb540ccf","src/store_impls/dynamic/prefix.rs":"b0524c43ac5395885048ca9cc7b82a18e15d28627b7241e22c4a4ceb95ec57ab","src/store_impls/dynamic/structure.rs":"b182acf94e314c5f1b63828461ce17ee500b33cd28875f6ad49bdf542da610fd","src/store_impls/dynamic/types.rs":"d0fed7b17cadedb5401f0137d3a9890efd9f135919b01070379a2bc0a218c36b","src/store_impls/dynamic/verify.rs":"ff5fa72a1851f58936bbc78850b5f975703ef536e3857d24e4d1e55d1890535e","src/store_impls/dynamic/write.rs":"b281fbbc349377a7bd73b68370f7a508cddf35db4e1d4409fc0fff0ca8386d43","src/store_impls/loose/find.rs":"bccbf49e3a5f01dee623a6818e03273d5218c3e934f06538daa283a79015b335","src/store_impls/loose/iter.rs":"52dd3df3148aa057efcbb2c86bb631834cbe9afdfb4a487fb6d1fe3e947b2c86","src/store_impls/loose/mod.rs":"9008a952ad41b7a9672028b6dd6d7fd613328694657f13e55ef078872ab8975e","src/store_impls/loose/verify.rs":"0170696d3bdf9be8c13ea4d236bda6c01efec8b8c627cbbfdb264457b0b1978b","src/store_impls/loose/write.rs":"ca7b307672c1eff65385a7675e01edcfc8ffcf5ceb085ea9efad813c6c09ae47","src/store_impls/mod.rs":"d5f123c2037dd5ee538721ad626aebf845d445d43438c3e10daac34d73fdc779","src/traits.rs":"9f77ef94dd7e021cceda22ba0929b6fa3a2e888acfd54f0dd4e8d6418dbda2b7"},"package":"4b234d806278eeac2f907c8b5a105c4ba537230c1a9d9236d822bf0db291f8f3"} \ No newline at end of file +{"files":{"CHANGELOG.md":"342ad969a43d9a1950733b04aed37239fd72d33c8f399f2ebf64ca97fe75e023","Cargo.toml":"ff36058d885a5080a5da793cde1226e9e75a482240f2ace5d96930e8c66688a9","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/alternate/mod.rs":"18913fe47e6527f7bdcf251a794fda764f3ba750aa890b8ee4b35328f0f04c6a","src/alternate/parse.rs":"418f5c54d6293ceb886d44a3482dd3a2378d50031ff04186541c5e09be2eedcc","src/cache.rs":"02a4fcc9ab540799fc8529830738284f4cff0bbfebf4f336e5611b1206ed9ab6","src/find.rs":"96d3b0d53f17ddc829b915259c5da7ef91c23575f8578bbe1c7ecec88c959590","src/lib.rs":"84f2f19a5e3f43e04b1829bff265a22f414e2399e4e2af3930bfd7af042e6d9a","src/sink.rs":"bdefb41defd4c8b1b152772d927ae70c63af559ce5b52a8d0f41584954a53d66","src/store_impls/dynamic/access.rs":"524b85c6f523f24ba6c0a2abc5cb9555b535dd5d1ce4d42beedd2aae28e6d938","src/store_impls/dynamic/find.rs":"14cf1303704e5c4d426edf356c9e0003a4722f757fe01befe01f7781ee60b1e0","src/store_impls/dynamic/handle.rs":"9bc5a010125e3c38ca5f95b990b40e0e6a1f61885ed7b6e0578f813bd13c6dec","src/store_impls/dynamic/header.rs":"18632eeb39f1382bbd3a8c17fff9fa12084f6cd024675a63b1e21ee0ec5a80d1","src/store_impls/dynamic/init.rs":"f6c23c8f634d18f154bf4772531b2cd43737c195c844167025584af0a7dc79f6","src/store_impls/dynamic/iter.rs":"6473eb899855f7588482674b7561cdf444b0366d4af9e3b92831d0d8b090fff7","src/store_impls/dynamic/load_index.rs":"675cd09d46359a73e0e9f7ddac59e1bb3ca8500265eb495b649b88daa1610b92","src/store_impls/dynamic/load_one.rs":"fa0393f14a653d9116c7b470219175cccffa8bb2e981afc89d62a48778a6d825","src/store_impls/dynamic/metrics.rs":"ab54a9986a58e72301ed9a85155572e7a8e0df977177dc51491fc776883c4200","src/store_impls/dynamic/mod.rs":"5363636ea3ad3f63c66d5e34b9d750025058ce2ea14352ad518563c811f8dd3b","src/store_impls/dynamic/prefix.rs":"d6c0702a5dbc55b62d54fea24b6b00a7ec88fc76917dbf5901ce699a0902b9a5","src/store_impls/dynamic/structure.rs":"2231e15b6e26d398978f147875cbbd83c0704dd4449c75274c6bc1887b6149b4","src/store_impls/dynamic/types.rs":"98974099d9fbda59458b4db0b2dd46fd1e8c1a7bdef83ee68600f29c664227c5","src/store_impls/dynamic/verify.rs":"2a0fd7b54ec9ad1e8651769daffeba3b355993c2a0300f952748ddcf92247974","src/store_impls/dynamic/write.rs":"b83d47499e9fa07d8e45db8f1d78fd638c6b43defb28dc7372588ea21f1bb75f","src/store_impls/loose/find.rs":"1afcc151f989ecd3c6e5166e8fc8eef919ffdb18d2f0560bf4ae5d26d8291ae8","src/store_impls/loose/iter.rs":"52dd3df3148aa057efcbb2c86bb631834cbe9afdfb4a487fb6d1fe3e947b2c86","src/store_impls/loose/mod.rs":"9008a952ad41b7a9672028b6dd6d7fd613328694657f13e55ef078872ab8975e","src/store_impls/loose/verify.rs":"c4f2f6449b518ce36ee19b6500c08befd402056195f71a49f0a3a5869f42ead4","src/store_impls/loose/write.rs":"45240b4320ef95d4985247fec07e70f9faacc606ced23f3de1819ca8102e77b7","src/store_impls/mod.rs":"d5f123c2037dd5ee538721ad626aebf845d445d43438c3e10daac34d73fdc779","src/traits.rs":"3b12c04823e64db00bfa6490a9f538715c049ad6825f524c4ff5a52943f4ceb7"},"package":"8d6a392c6ba3a2f133cdc63120e9bc7aec81eef763db372c817de31febfe64bf"} \ No newline at end of file diff --git a/vendor/gix-odb/CHANGELOG.md b/vendor/gix-odb/CHANGELOG.md index 75ad4adb0..0032f0d90 100644 --- a/vendor/gix-odb/CHANGELOG.md +++ b/vendor/gix-odb/CHANGELOG.md @@ -5,6 +5,314 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 0.53.0 (2023-09-24) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 1 commit contributed to the release. + - 16 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Prepare changelogs prior to release ([`8a60d5b`](https://github.com/Byron/gitoxide/commit/8a60d5b80877c213c3b646d3061e8a33e0e433ec)) +
+ +## 0.52.0 (2023-09-08) + + + +### Chore (BREAKING) + + - update to the latest `prodash` + It makes proper usage of `Progress` types easier and allows them to be used + as `dyn` traits as well. + +### Bug Fixes (BREAKING) + + - use `dyn` trait where possible. + This reduces compile time due to avoiding duplication. + +### Commit Statistics + + + + - 13 commits contributed to the release over the course of 17 calendar days. + - 17 days passed between releases. + - 2 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Thanks Clippy + + + +[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic. + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-date v0.8.0, gix-hash v0.13.0, gix-features v0.34.0, gix-actor v0.26.0, gix-object v0.36.0, gix-path v0.10.0, gix-glob v0.12.0, gix-attributes v0.18.0, gix-packetline-blocking v0.16.6, gix-filter v0.4.0, gix-fs v0.6.0, gix-commitgraph v0.20.0, gix-hashtable v0.4.0, gix-revwalk v0.7.0, gix-traverse v0.32.0, gix-worktree-stream v0.4.0, gix-archive v0.4.0, gix-config-value v0.14.0, gix-tempfile v9.0.0, gix-lock v9.0.0, gix-ref v0.36.0, gix-sec v0.10.0, gix-config v0.29.0, gix-prompt v0.7.0, gix-url v0.23.0, gix-credentials v0.19.0, gix-diff v0.35.0, gix-discover v0.24.0, gix-ignore v0.7.0, gix-index v0.24.0, gix-macros v0.1.0, gix-mailmap v0.18.0, gix-negotiate v0.7.0, gix-pack v0.42.0, gix-odb v0.52.0, gix-pathspec v0.2.0, gix-packetline v0.16.6, gix-transport v0.36.0, gix-protocol v0.39.0, gix-revision v0.21.0, gix-refspec v0.17.0, gix-submodule v0.3.0, gix-worktree v0.25.0, gix-worktree-state v0.2.0, gix v0.53.0, safety bump 39 crates ([`8bd0456`](https://github.com/Byron/gitoxide/commit/8bd045676bb2cdc02624ab93e73ff8518064ca38)) + - Prepare changelogs for release ([`375db06`](https://github.com/Byron/gitoxide/commit/375db06a8442378c3f7a922fae38e2a6694d9d04)) + - Merge branch 'optimizations' ([`6135a5e`](https://github.com/Byron/gitoxide/commit/6135a5ea8709646f01da62939a59dd3a9750e007)) + - Adapt to changes in features of `gix-pack` ([`6b27ffa`](https://github.com/Byron/gitoxide/commit/6b27ffa18f0049321e7c1837acc5467f0966fbb5)) + - Merge branch `dyn`ification ([`f658fcc`](https://github.com/Byron/gitoxide/commit/f658fcc52dc2200ae34ca53dc10be97fb9012057)) + - Use `dyn` trait where possible. ([`072ee32`](https://github.com/Byron/gitoxide/commit/072ee32f693a31161cd6a843da6582d13efbb20b)) + - Update to the latest `prodash` ([`ed327f6`](https://github.com/Byron/gitoxide/commit/ed327f6163f54756e58c20f86a563a97efb256ca)) + - Merge branch 'perf-and-safety' ([`9ad9c5b`](https://github.com/Byron/gitoxide/commit/9ad9c5b1cfa3afff5273558b6ef98ca4714d4272)) + - Adapt to changes in `gix-pack` ([`46a4d4d`](https://github.com/Byron/gitoxide/commit/46a4d4d873610ba88d51bce865404b904b2b7cb3)) + - Merge branch 'adjustments-for-cargo' ([`b7560a2`](https://github.com/Byron/gitoxide/commit/b7560a2445b62f888bf5aa2ba4c5a47ae037cb23)) + - Release gix-date v0.7.4, gix-index v0.23.0, safety bump 5 crates ([`3be2b1c`](https://github.com/Byron/gitoxide/commit/3be2b1ccfe30eeae45711c64b88efc522a2b51b7)) + - Thanks clippy ([`5044c3b`](https://github.com/Byron/gitoxide/commit/5044c3b87456cf58ebfbbd00f23c9ba671cb290c)) + - Merge branch 'gix-submodule' ([`363ee77`](https://github.com/Byron/gitoxide/commit/363ee77400805f473c9ad66eadad9214e7ab66f4)) +
+ +## 0.51.0 (2023-08-22) + + + +### Chore + + - reorganize tests to get rid of feature toggles that are for internal testing only + +### Commit Statistics + + + + - 9 commits contributed to the release over the course of 18 calendar days. + - 19 days passed between releases. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-url v0.22.0, gix-credentials v0.18.0, gix-diff v0.34.0, gix-discover v0.23.0, gix-ignore v0.6.0, gix-bitmap v0.2.7, gix-index v0.22.0, gix-mailmap v0.17.0, gix-negotiate v0.6.0, gix-pack v0.41.0, gix-odb v0.51.0, gix-pathspec v0.1.0, gix-packetline v0.16.5, gix-transport v0.35.0, gix-protocol v0.38.0, gix-revision v0.20.0, gix-refspec v0.16.0, gix-submodule v0.2.0, gix-worktree v0.24.0, gix-worktree-state v0.1.0, gix v0.52.0, gitoxide-core v0.31.0, gitoxide v0.29.0 ([`6c62e74`](https://github.com/Byron/gitoxide/commit/6c62e748240ac0980fc23fdf30f8477dea8b9bc3)) + - Release gix-date v0.7.3, gix-hash v0.12.0, gix-features v0.33.0, gix-actor v0.25.0, gix-object v0.35.0, gix-path v0.9.0, gix-glob v0.11.0, gix-quote v0.4.7, gix-attributes v0.17.0, gix-command v0.2.9, gix-packetline-blocking v0.16.5, gix-filter v0.3.0, gix-fs v0.5.0, gix-commitgraph v0.19.0, gix-hashtable v0.3.0, gix-revwalk v0.6.0, gix-traverse v0.31.0, gix-worktree-stream v0.3.0, gix-archive v0.3.0, gix-config-value v0.13.0, gix-tempfile v8.0.0, gix-lock v8.0.0, gix-ref v0.35.0, gix-sec v0.9.0, gix-config v0.28.0, gix-prompt v0.6.0, gix-url v0.22.0, gix-credentials v0.18.0, gix-diff v0.34.0, gix-discover v0.23.0, gix-ignore v0.6.0, gix-bitmap v0.2.7, gix-index v0.22.0, gix-mailmap v0.17.0, gix-negotiate v0.6.0, gix-pack v0.41.0, gix-odb v0.51.0, gix-pathspec v0.1.0, gix-packetline v0.16.5, gix-transport v0.35.0, gix-protocol v0.38.0, gix-revision v0.20.0, gix-refspec v0.16.0, gix-submodule v0.2.0, gix-worktree v0.24.0, gix-worktree-state v0.1.0, gix v0.52.0, gitoxide-core v0.31.0, gitoxide v0.29.0, safety bump 41 crates ([`30b2761`](https://github.com/Byron/gitoxide/commit/30b27615047692d3ced1b2d9c2ac15a80f79fbee)) + - Remove version specifications from dev dependencies ([`e80ed04`](https://github.com/Byron/gitoxide/commit/e80ed04f1cc065c5f4ddf196e780a8a8511a8069)) + - Update changelogs prior to release ([`f23ea88`](https://github.com/Byron/gitoxide/commit/f23ea8828f2d9ba7559973daca388c9591bcc5fc)) + - Merge branch 'gix-submodule' ([`8f3f358`](https://github.com/Byron/gitoxide/commit/8f3f358800f1fe77d7ba7ebd396a90b692d3c0c1)) + - Reorganize tests to get rid of feature toggles that are for internal testing only ([`01c6ef6`](https://github.com/Byron/gitoxide/commit/01c6ef62e260246f1623bdf05f49c03eff14ac69)) + - Release gix-glob v0.10.2, gix-date v0.7.2, gix-validate v0.8.0, gix-object v0.34.0, gix-ref v0.34.0, gix-config v0.27.0, gix-commitgraph v0.18.2, gix-revwalk v0.5.0, gix-revision v0.19.0, gix-refspec v0.15.0, gix-submodule v0.1.0, safety bump 18 crates ([`4604f83`](https://github.com/Byron/gitoxide/commit/4604f83ef238dc07c85aaeae097399b67f3cfd0c)) + - Merge branch 'dev-on-linux' ([`6b4a303`](https://github.com/Byron/gitoxide/commit/6b4a30330fe49fc97daa73f55bf56580cc0597aa)) + - Fix various tests to run properly on linux ([`ef8ccd9`](https://github.com/Byron/gitoxide/commit/ef8ccd9d16143d37155d063747c69cade80f162d)) +
+ +## 0.50.2 (2023-08-02) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 5 commits contributed to the release. + - 10 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-actor v0.24.2, gix-object v0.33.2, gix-ref v0.33.3, gix-config v0.26.2, gix-prompt v0.5.5, gix-odb v0.50.2, gix-transport v0.34.2, gix-protocol v0.37.0, gix-worktree v0.23.1, gix v0.51.0, safety bump 3 crates ([`231ac1c`](https://github.com/Byron/gitoxide/commit/231ac1c6ad5ca9a84dbeb0dee14bfbf2fef1ae1e)) + - Prepare additional changelogs ([`db63815`](https://github.com/Byron/gitoxide/commit/db6381522395a0de047118e81df5cd3cbeb862b9)) + - Prepare changelogs ([`e4d2890`](https://github.com/Byron/gitoxide/commit/e4d2890a85bf60e9cdb4016dddfab3c4dccbe75e)) + - Merge branch 'fixes-and-improvements' ([`f8b1f55`](https://github.com/Byron/gitoxide/commit/f8b1f553371f25b1bea6bce7cbb2ff1f01194856)) + - Add note go ODB initialization in preparation for dealing with many small packs. ([`090357e`](https://github.com/Byron/gitoxide/commit/090357ee7b36ead5c622b13b1fabab5174499d82)) +
+ +## 0.50.1 (2023-07-22) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 7 commits contributed to the release over the course of 1 calendar day. + - 3 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0 ([`0062971`](https://github.com/Byron/gitoxide/commit/00629710dffeb10fda340665530353703cf5d129)) + - Release gix-tempfile v7.0.2, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.1, gix-sec v0.8.4, gix-prompt v0.5.4, gix-url v0.21.1, gix-credentials v0.17.1, gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0 ([`107a64e`](https://github.com/Byron/gitoxide/commit/107a64e734580ad9e2c4142db96394529d8072df)) + - Release gix-features v0.32.1, gix-actor v0.24.1, gix-validate v0.7.7, gix-object v0.33.1, gix-path v0.8.4, gix-glob v0.10.1, gix-quote v0.4.6, gix-attributes v0.16.0, gix-command v0.2.8, gix-packetline-blocking v0.16.4, gix-filter v0.2.0, gix-fs v0.4.1, gix-chunk v0.4.4, gix-commitgraph v0.18.1, gix-hashtable v0.2.4, gix-revwalk v0.4.1, gix-traverse v0.30.1, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.5, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.1, gix-sec v0.8.4, gix-prompt v0.5.4, gix-url v0.21.1, gix-credentials v0.17.1, gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0, safety bump 5 crates ([`16295b5`](https://github.com/Byron/gitoxide/commit/16295b58e2581d2e8b8b762816f52baabe871c75)) + - Prepare more changelogs ([`c4cc5f2`](https://github.com/Byron/gitoxide/commit/c4cc5f261d29f712a101033a18293a97a9d4ae85)) + - Release gix-date v0.7.1, gix-hash v0.11.4, gix-trace v0.1.3, gix-features v0.32.0, gix-actor v0.24.0, gix-validate v0.7.7, gix-object v0.33.0, gix-path v0.8.4, gix-glob v0.10.0, gix-quote v0.4.6, gix-attributes v0.15.0, gix-command v0.2.7, gix-packetline-blocking v0.16.3, gix-filter v0.1.0, gix-fs v0.4.0, gix-chunk v0.4.4, gix-commitgraph v0.18.0, gix-hashtable v0.2.4, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.4, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.0, gix-sec v0.8.4, gix-prompt v0.5.3, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-ignore v0.5.0, gix-bitmap v0.2.6, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-packetline v0.16.4, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.1 ([`5cb3589`](https://github.com/Byron/gitoxide/commit/5cb3589b74fc5376e02cbfe151e71344e1c417fe)) + - Update changelogs prior to release ([`2fc66b5`](https://github.com/Byron/gitoxide/commit/2fc66b55097ed494b72d1af939ba5561f71fde97)) + - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e)) +
+ +## 0.50.0 (2023-07-19) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 4 commits contributed to the release. + - 19 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-filter v0.1.0, gix-ignore v0.5.0, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.0 ([`4aca8c2`](https://github.com/Byron/gitoxide/commit/4aca8c2ae2ec588fb65ec4faa0c07c19d219569f)) + - Release gix-features v0.32.0, gix-actor v0.24.0, gix-glob v0.10.0, gix-attributes v0.15.0, gix-commitgraph v0.18.0, gix-config-value v0.12.4, gix-fs v0.4.0, gix-object v0.33.0, gix-ref v0.33.0, gix-config v0.26.0, gix-command v0.2.7, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-filter v0.1.0, gix-ignore v0.5.0, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.0 ([`68ae3ff`](https://github.com/Byron/gitoxide/commit/68ae3ff9d642ec56f088a6a682a073dc16f4e8ca)) + - Adjust package versions (by cargo-smart-release) ([`c70e54f`](https://github.com/Byron/gitoxide/commit/c70e54f163c312c87753a506eeaad462e8579bfb)) + - Prepare changelogs prior to release ([`e4dded0`](https://github.com/Byron/gitoxide/commit/e4dded05138562f9737a7dcfb60570c55769486d)) +
+ +## 0.49.1 (2023-06-29) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 3 commits contributed to the release. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-glob v0.9.1, gix-attributes v0.14.1, gix-config-value v0.12.3, gix-ref v0.32.1, gix-sec v0.8.3, gix-config v0.25.1, gix-url v0.20.1, gix-credentials v0.16.1, gix-discover v0.21.1, gix-ignore v0.4.1, gix-pack v0.39.1, gix-odb v0.49.1, gix-worktree v0.21.1, gix v0.48.0 ([`69c6a36`](https://github.com/Byron/gitoxide/commit/69c6a36ba14cbef129deebda9fd8870005fefa17)) + - Prepare changelogs prior to release ([`c143cf4`](https://github.com/Byron/gitoxide/commit/c143cf48ee1885467e3e9262a3f8823a1247bfe0)) + - Align usage of `gix-path` across all crates ([`73c1292`](https://github.com/Byron/gitoxide/commit/73c1292be393986c4a1adde1400abf551e850da0)) +
+ +## 0.49.0 (2023-06-29) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 2 commits contributed to the release. + - 6 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-date v0.7.0, gix-trace v0.1.2, gix-actor v0.23.0, gix-commitgraph v0.17.1, gix-utils v0.1.4, gix-object v0.32.0, gix-ref v0.32.0, gix-config v0.25.0, gix-diff v0.32.0, gix-discover v0.21.0, gix-hashtable v0.2.3, gix-revwalk v0.3.0, gix-traverse v0.29.0, gix-index v0.20.0, gix-mailmap v0.15.0, gix-negotiate v0.4.0, gix-pack v0.39.0, gix-odb v0.49.0, gix-protocol v0.35.0, gix-revision v0.17.0, gix-refspec v0.13.0, gix-worktree v0.21.0, gix v0.48.0, safety bump 20 crates ([`27e8c18`](https://github.com/Byron/gitoxide/commit/27e8c18db5a9a21843381c116a8ed6d9f681b3f8)) + - Prepare changelogs prior to release ([`00f96fb`](https://github.com/Byron/gitoxide/commit/00f96fb3110a8f81a1bd0d74c757c15b8773c6f6)) +
+ +## 0.48.0 (2023-06-22) + + + +### Chore + + - Add `clippy::redundant-closure-for-method-calls` lint + +### New Features + + - provide basic `tracing` spans for common operations. + This is just the beginning and more crates will integrate with it over time. + +### Commit Statistics + + + + - 13 commits contributed to the release over the course of 11 calendar days. + - 12 days passed between releases. + - 2 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-date v0.6.0, gix-hash v0.11.3, gix-trace v0.1.1, gix-features v0.31.0, gix-actor v0.22.0, gix-path v0.8.2, gix-glob v0.9.0, gix-quote v0.4.5, gix-attributes v0.14.0, gix-chunk v0.4.3, gix-commitgraph v0.17.0, gix-config-value v0.12.2, gix-fs v0.3.0, gix-tempfile v7.0.0, gix-utils v0.1.3, gix-lock v7.0.0, gix-validate v0.7.6, gix-object v0.31.0, gix-ref v0.31.0, gix-sec v0.8.2, gix-config v0.24.0, gix-command v0.2.6, gix-prompt v0.5.2, gix-url v0.20.0, gix-credentials v0.16.0, gix-diff v0.31.0, gix-discover v0.20.0, gix-hashtable v0.2.2, gix-ignore v0.4.0, gix-bitmap v0.2.5, gix-revwalk v0.2.0, gix-traverse v0.28.0, gix-index v0.19.0, gix-mailmap v0.14.0, gix-negotiate v0.3.0, gix-pack v0.38.0, gix-odb v0.48.0, gix-packetline v0.16.3, gix-transport v0.33.0, gix-protocol v0.34.0, gix-revision v0.16.0, gix-refspec v0.12.0, gix-worktree v0.20.0, gix v0.47.0, gitoxide-core v0.29.0, gitoxide v0.27.0, safety bump 30 crates ([`ea9f942`](https://github.com/Byron/gitoxide/commit/ea9f9424e777f10da0e33bb9ffbbefd01c4c5a74)) + - Prepare changelogs prior to release ([`18b0a37`](https://github.com/Byron/gitoxide/commit/18b0a371941aa2d4d62512437d5daa351ba99ffd)) + - `just fmt` ([`871dd0b`](https://github.com/Byron/gitoxide/commit/871dd0b977caf17159092a4739ba5408403cdb2c)) + - Merge branch 'gix-corpus' ([`5861afb`](https://github.com/Byron/gitoxide/commit/5861afb45f32c16eefcd8e7b7480309bf44b6edc)) + - Add more tasks to gather a little more information ([`891a061`](https://github.com/Byron/gitoxide/commit/891a06107883b4a21796facf046a0cd697dc2134)) + - Merge branch 'corpus' ([`aa16c8c`](https://github.com/Byron/gitoxide/commit/aa16c8ce91452a3e3063cf1cf0240b6014c4743f)) + - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30)) + - Provide basic `tracing` spans for common operations. ([`3cffa26`](https://github.com/Byron/gitoxide/commit/3cffa268460eb2d41bd6a30d45778b88db4ec602)) + - Merge branch 'help-874-redundant-closures' ([`fe59956`](https://github.com/Byron/gitoxide/commit/fe59956ad667303a923d7cfd9ffd72283df41d78)) + - Add `clippy::redundant-closure-for-method-calls` lint ([`bcad5c2`](https://github.com/Byron/gitoxide/commit/bcad5c22049d56a25ef69d6c7a3344e78f9a1d4d)) + - Merge branch 'future-dates' ([`8d2e6a9`](https://github.com/Byron/gitoxide/commit/8d2e6a91ac92a033e9e3daad5cffa90263075536)) + - Adapt to changes in `gix-actor` ([`4a80e86`](https://github.com/Byron/gitoxide/commit/4a80e868f9530896616e649838e9be64b6d10036)) + - Adapt to changes in `gix-date` ([`d575336`](https://github.com/Byron/gitoxide/commit/d575336c26e6026e463cd06d88266bb2bdd3e162)) +
+ +## 0.47.0 (2023-06-10) + +A maintenance release without user-facing changes. + +### Commit Statistics + + + + - 2 commits contributed to the release. + - 3 days passed between releases. + - 0 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + + + +
view details + + * **Uncategorized** + - Release gix-attributes v0.13.1, gix-diff v0.30.1, gix-revwalk v0.1.0, gix-traverse v0.27.0, gix-index v0.18.0, gix-revision v0.15.2, gix-negotiate v0.2.1, gix-pack v0.37.0, gix-odb v0.47.0, gix-protocol v0.33.2, gix-worktree v0.19.0, gix v0.46.0, safety bump 7 crates ([`2560a2c`](https://github.com/Byron/gitoxide/commit/2560a2cc3e1d8c60cd812e15696fa4761d036e19)) + - Prepare changelogs prior to release ([`298f3d7`](https://github.com/Byron/gitoxide/commit/298f3d7359c5b183314d8c584e45dcdd559d88b3)) +
+ ## 0.46.0 (2023-06-06) ### New Features @@ -18,7 +326,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - - 16 commits contributed to the release over the course of 25 calendar days. + - 17 commits contributed to the release over the course of 25 calendar days. - 40 days passed between releases. - 2 commits were understood as [conventional](https://www.conventionalcommits.org). - 0 issues like '(#ID)' were seen in commit messages @@ -30,6 +338,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
view details * **Uncategorized** + - Release gix-date v0.5.1, gix-hash v0.11.2, gix-features v0.30.0, gix-actor v0.21.0, gix-path v0.8.1, gix-glob v0.8.0, gix-quote v0.4.4, gix-attributes v0.13.0, gix-chunk v0.4.2, gix-commitgraph v0.16.0, gix-config-value v0.12.1, gix-fs v0.2.0, gix-tempfile v6.0.0, gix-utils v0.1.2, gix-lock v6.0.0, gix-validate v0.7.5, gix-object v0.30.0, gix-ref v0.30.0, gix-sec v0.8.1, gix-config v0.23.0, gix-command v0.2.5, gix-prompt v0.5.1, gix-url v0.19.0, gix-credentials v0.15.0, gix-diff v0.30.0, gix-discover v0.19.0, gix-hashtable v0.2.1, gix-ignore v0.3.0, gix-bitmap v0.2.4, gix-traverse v0.26.0, gix-index v0.17.0, gix-mailmap v0.13.0, gix-revision v0.15.0, gix-negotiate v0.2.0, gix-pack v0.36.0, gix-odb v0.46.0, gix-packetline v0.16.2, gix-transport v0.32.0, gix-protocol v0.33.0, gix-refspec v0.11.0, gix-worktree v0.18.0, gix v0.45.0, safety bump 29 crates ([`9a9fa96`](https://github.com/Byron/gitoxide/commit/9a9fa96fa8a722bddc5c3b2270b0edf8f6615141)) - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b)) - Merge branch 'integrate-gix-negotiate' ([`ae845de`](https://github.com/Byron/gitoxide/commit/ae845dea6cee6523c88a23d7a14293589cf8092f)) - Add `Store::alternate_db_paths()`. ([`8c72a23`](https://github.com/Byron/gitoxide/commit/8c72a236dbeb71a4aead45bf82010f1c89829540)) diff --git a/vendor/gix-odb/Cargo.toml b/vendor/gix-odb/Cargo.toml index a171d68b3..cf5b98392 100644 --- a/vendor/gix-odb/Cargo.toml +++ b/vendor/gix-odb/Cargo.toml @@ -11,17 +11,18 @@ [package] edition = "2021" -rust-version = "1.64" +rust-version = "1.65" name = "gix-odb" -version = "0.46.0" +version = "0.53.0" authors = ["Sebastian Thiel "] include = [ "src/**/*", "LICENSE-*", "CHANGELOG.md", ] +autotests = false description = "Implements various git object databases" -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/Byron/gitoxide" [package.metadata.docs.rs] @@ -37,16 +38,6 @@ rustdoc-args = [ [lib] doctest = false -[[test]] -name = "multi-threaded" -path = "tests/odb-multi-threaded.rs" -required-features = ["internal-testing-gix-features-parallel"] - -[[test]] -name = "single-threaded" -path = "tests/odb-single-threaded.rs" -required-features = [] - [dependencies.arc-swap] version = "1.5.0" @@ -54,8 +45,11 @@ version = "1.5.0" version = "0.2.0" optional = true +[dependencies.gix-date] +version = "^0.8.0" + [dependencies.gix-features] -version = "^0.30.0" +version = "^0.35.0" features = [ "rustsha1", "walkdir", @@ -64,19 +58,20 @@ features = [ ] [dependencies.gix-hash] -version = "^0.11.2" +version = "^0.13.0" [dependencies.gix-object] -version = "^0.30.0" +version = "^0.37.0" [dependencies.gix-pack] -version = "^0.36.0" +version = "^0.43.0" +default-features = false [dependencies.gix-path] -version = "^0.8.1" +version = "^0.10.0" [dependencies.gix-quote] -version = "^0.4.4" +version = "^0.4.7" [dependencies.parking_lot] version = "0.12.0" @@ -93,20 +88,7 @@ version = "3.1.0" [dependencies.thiserror] version = "1.0.26" -[dev-dependencies.crossbeam-channel] -version = "0.5.6" - -[dev-dependencies.filetime] -version = "0.2.15" - -[dev-dependencies.maplit] -version = "1.0.2" - -[dev-dependencies.pretty_assertions] -version = "1.0.0" - [features] -internal-testing-gix-features-parallel = ["gix-features/parallel"] serde = [ "dep:serde", "gix-hash/serde", diff --git a/vendor/gix-odb/src/alternate/mod.rs b/vendor/gix-odb/src/alternate/mod.rs index c343ef5aa..c4e9fc8c0 100644 --- a/vendor/gix-odb/src/alternate/mod.rs +++ b/vendor/gix-odb/src/alternate/mod.rs @@ -42,21 +42,16 @@ pub enum Error { /// If no alternate object database was resolved, the resulting `Vec` is empty (it is not an error /// if there are no alternates). /// It is an error once a repository is seen again as it would lead to a cycle. -pub fn resolve( - objects_directory: impl Into, - current_dir: impl AsRef, -) -> Result, Error> { - let relative_base = objects_directory.into(); - let mut dirs = vec![(0, relative_base.clone())]; +pub fn resolve(objects_directory: PathBuf, current_dir: &std::path::Path) -> Result, Error> { + let mut dirs = vec![(0, objects_directory.clone())]; let mut out = Vec::new(); - let cwd = current_dir.as_ref(); - let mut seen = vec![gix_path::realpath_opts(&relative_base, cwd, MAX_SYMLINKS)?]; + let mut seen = vec![gix_path::realpath_opts(&objects_directory, current_dir, MAX_SYMLINKS)?]; while let Some((depth, dir)) = dirs.pop() { match fs::read(dir.join("info").join("alternates")) { Ok(input) => { for path in parse::content(&input)?.into_iter() { - let path = relative_base.join(path); - let path_canonicalized = gix_path::realpath_opts(&path, cwd, MAX_SYMLINKS)?; + let path = objects_directory.join(path); + let path_canonicalized = gix_path::realpath_opts(&path, current_dir, MAX_SYMLINKS)?; if seen.contains(&path_canonicalized) { return Err(Error::Cycle(seen)); } diff --git a/vendor/gix-odb/src/cache.rs b/vendor/gix-odb/src/cache.rs index 8e108646f..87c8da4ed 100644 --- a/vendor/gix-odb/src/cache.rs +++ b/vendor/gix-odb/src/cache.rs @@ -133,7 +133,7 @@ impl DerefMut for Cache { } mod impls { - use std::{io::Read, ops::DerefMut}; + use std::{cell::RefCell, io::Read, ops::DerefMut}; use gix_hash::{oid, ObjectId}; use gix_object::{Data, Kind}; @@ -145,9 +145,7 @@ mod impls { where S: crate::Write, { - type Error = S::Error; - - fn write_stream(&self, kind: Kind, size: u64, from: impl Read) -> Result { + fn write_stream(&self, kind: Kind, size: u64, from: &mut dyn Read) -> Result { self.inner.write_stream(kind, size, from) } } @@ -156,13 +154,11 @@ mod impls { where S: gix_pack::Find, { - type Error = S::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &oid) -> bool { self.inner.contains(id) } - fn try_find<'a>(&self, id: impl AsRef, buffer: &'a mut Vec) -> Result>, Self::Error> { + fn try_find<'a>(&self, id: &oid, buffer: &'a mut Vec) -> Result>, crate::find::Error> { gix_pack::Find::try_find(self, id, buffer).map(|t| t.map(|t| t.0)) } } @@ -171,9 +167,7 @@ mod impls { where S: crate::Header, { - type Error = S::Error; - - fn try_header(&self, id: impl AsRef) -> Result, Self::Error> { + fn try_header(&self, id: &oid) -> Result, crate::find::Error> { self.inner.try_header(id) } } @@ -182,18 +176,16 @@ mod impls { where S: gix_pack::Find, { - type Error = S::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &oid) -> bool { self.inner.contains(id) } fn try_find<'a>( &self, - id: impl AsRef, + id: &oid, buffer: &'a mut Vec, - ) -> Result, Option)>, Self::Error> { - match self.pack_cache.as_ref().map(|rc| rc.borrow_mut()) { + ) -> Result, Option)>, crate::find::Error> { + match self.pack_cache.as_ref().map(RefCell::borrow_mut) { Some(mut pack_cache) => self.try_find_cached(id, buffer, pack_cache.deref_mut()), None => self.try_find_cached(id, buffer, &mut gix_pack::cache::Never), } @@ -201,25 +193,25 @@ mod impls { fn try_find_cached<'a>( &self, - id: impl AsRef, + id: &oid, buffer: &'a mut Vec, - pack_cache: &mut impl gix_pack::cache::DecodeEntry, - ) -> Result, Option)>, Self::Error> { - if let Some(mut obj_cache) = self.object_cache.as_ref().map(|rc| rc.borrow_mut()) { + pack_cache: &mut dyn gix_pack::cache::DecodeEntry, + ) -> Result, Option)>, crate::find::Error> { + if let Some(mut obj_cache) = self.object_cache.as_ref().map(RefCell::borrow_mut) { if let Some(kind) = obj_cache.get(&id.as_ref().to_owned(), buffer) { return Ok(Some((Data::new(kind, buffer), None))); } } let possibly_obj = self.inner.try_find_cached(id.as_ref(), buffer, pack_cache)?; if let (Some(mut obj_cache), Some((obj, _location))) = - (self.object_cache.as_ref().map(|rc| rc.borrow_mut()), &possibly_obj) + (self.object_cache.as_ref().map(RefCell::borrow_mut), &possibly_obj) { obj_cache.put(id.as_ref().to_owned(), obj.kind, obj.data); } Ok(possibly_obj) } - fn location_by_oid(&self, id: impl AsRef, buf: &mut Vec) -> Option { + fn location_by_oid(&self, id: &oid, buf: &mut Vec) -> Option { self.inner.location_by_oid(id, buf) } diff --git a/vendor/gix-odb/src/find.rs b/vendor/gix-odb/src/find.rs index 69eccbf04..bf807e27c 100644 --- a/vendor/gix-odb/src/find.rs +++ b/vendor/gix-odb/src/find.rs @@ -1,3 +1,5 @@ +/// The error type returned by the [`Find`](crate::Find) and [`Header`](crate::Header) traits. +pub type Error = Box; /// pub mod existing { use gix_hash::ObjectId; @@ -5,9 +7,9 @@ pub mod existing { /// The error returned by the [`find(…)`][crate::FindExt::find()] trait methods. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] - pub enum Error { + pub enum Error { #[error(transparent)] - Find(T), + Find(crate::find::Error), #[error("An object with id {} could not be found", .oid)] NotFound { oid: ObjectId }, } @@ -20,9 +22,9 @@ pub mod existing_object { /// The error returned by the various [`find_*()`][crate::FindExt::find_commit()] trait methods. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] - pub enum Error { + pub enum Error { #[error(transparent)] - Find(T), + Find(crate::find::Error), #[error(transparent)] Decode(gix_object::decode::Error), #[error("An object with id {oid} could not be found")] @@ -39,9 +41,9 @@ pub mod existing_iter { /// The error returned by the various [`find_*_iter()`][crate::FindExt::find_commit_iter()] trait methods. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] - pub enum Error { + pub enum Error { #[error(transparent)] - Find(T), + Find(crate::find::Error), #[error("An object with id {oid} could not be found")] NotFound { oid: ObjectId }, #[error("Expected object of kind {expected}")] diff --git a/vendor/gix-odb/src/lib.rs b/vendor/gix-odb/src/lib.rs index e0beac548..5aee76ca2 100644 --- a/vendor/gix-odb/src/lib.rs +++ b/vendor/gix-odb/src/lib.rs @@ -76,6 +76,12 @@ mod traits; pub use traits::{Find, FindExt, Header, HeaderExt, Write}; +/// +pub mod write { + /// The error type returned by the [`Write`](crate::Write) trait. + pub type Error = Box; +} + /// A thread-local handle to access any object. pub type Handle = Cache>>; /// A thread-local handle to access any object, but thread-safe and independent of the actual type of `OwnShared` or feature toggles in `gix-features`. @@ -142,11 +148,16 @@ pub fn at_opts( replacements: impl IntoIterator, options: store::init::Options, ) -> std::io::Result { - let handle = OwnShared::new(Store::at_opts(objects_dir, replacements, options)?).to_handle(); + let handle = OwnShared::new(Store::at_opts( + objects_dir.into(), + &mut replacements.into_iter(), + options, + )?) + .to_handle(); Ok(Cache::from(handle)) } /// Create a new cached handle to the object store. pub fn at(objects_dir: impl Into) -> std::io::Result { - at_opts(objects_dir, Vec::new().into_iter(), Default::default()) + at_opts(objects_dir, Vec::new(), Default::default()) } diff --git a/vendor/gix-odb/src/sink.rs b/vendor/gix-odb/src/sink.rs index 44a406151..f6334a51c 100644 --- a/vendor/gix-odb/src/sink.rs +++ b/vendor/gix-odb/src/sink.rs @@ -21,14 +21,12 @@ impl Sink { } impl crate::traits::Write for Sink { - type Error = io::Error; - fn write_stream( &self, kind: gix_object::Kind, size: u64, - mut from: impl io::Read, - ) -> Result { + from: &mut dyn io::Read, + ) -> Result { let mut size = size.try_into().expect("object size to fit into usize"); let mut buf = [0u8; 8096]; let header = gix_object::encode::loose_header(kind, size); @@ -42,18 +40,18 @@ impl crate::traits::Write for Sink { let mut hasher = gix_features::hash::hasher(self.object_hash); hasher.update(&header); - possibly_compress(&header)?; + possibly_compress(&header).map_err(Box::new)?; while size != 0 { let bytes = size.min(buf.len()); - from.read_exact(&mut buf[..bytes])?; + from.read_exact(&mut buf[..bytes]).map_err(Box::new)?; hasher.update(&buf[..bytes]); - possibly_compress(&buf[..bytes])?; + possibly_compress(&buf[..bytes]).map_err(Box::new)?; size -= bytes; } if let Some(compressor) = self.compressor.as_ref() { let mut c = compressor.borrow_mut(); - c.flush()?; + c.flush().map_err(Box::new)?; c.reset(); } diff --git a/vendor/gix-odb/src/store_impls/dynamic/find.rs b/vendor/gix-odb/src/store_impls/dynamic/find.rs index 88f95db51..b4cd25aeb 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/find.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/find.rs @@ -75,6 +75,7 @@ pub(crate) mod error { } } pub use error::Error; +use gix_features::zlib; use crate::{store::types::PackId, Find}; @@ -86,7 +87,8 @@ where &'b self, mut id: &'b gix_hash::oid, buffer: &'a mut Vec, - pack_cache: &mut impl DecodeEntry, + inflate: &mut zlib::Inflate, + pack_cache: &mut dyn DecodeEntry, snapshot: &mut load_index::Snapshot, recursion: Option>, ) -> Result, Option)>, Error> { @@ -147,7 +149,8 @@ where let res = match pack.decode_entry( entry, buffer, - |id, _out| { + inflate, + &|id, _out| { index_file.pack_offset_by_id(id).map(|pack_offset| { gix_pack::data::decode::entry::ResolvedBase::InPack(pack.entry(pack_offset)) }) @@ -182,10 +185,11 @@ where .try_find_cached_inner( &base_id, &mut buf, + inflate, pack_cache, snapshot, recursion - .map(|r| r.inc_depth()) + .map(error::DeltaBaseRecursion::inc_depth) .or_else(|| error::DeltaBaseRecursion::new(id).into()), ) .map_err(|err| Error::DeltaBaseLookup { @@ -231,7 +235,8 @@ where pack.decode_entry( entry, buffer, - |id, out| { + inflate, + &|id, out| { index_file .pack_offset_by_id(id) .map(|pack_offset| { @@ -306,11 +311,8 @@ impl gix_pack::Find for super::Handle where S: Deref + Clone, { - type Error = Error; - // TODO: probably make this method fallible, but that would mean its own error type. - fn contains(&self, id: impl AsRef) -> bool { - let id = id.as_ref(); + fn contains(&self, id: &gix_hash::oid) -> bool { let mut snapshot = self.snapshot.borrow_mut(); loop { for (idx, index) in snapshot.indices.iter().enumerate() { @@ -341,20 +343,17 @@ where fn try_find_cached<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - pack_cache: &mut impl DecodeEntry, - ) -> Result, Option)>, Self::Error> { - let id = id.as_ref(); + pack_cache: &mut dyn DecodeEntry, + ) -> Result, Option)>, gix_pack::find::Error> { let mut snapshot = self.snapshot.borrow_mut(); - self.try_find_cached_inner(id, buffer, pack_cache, &mut snapshot, None) + let mut inflate = self.inflate.borrow_mut(); + self.try_find_cached_inner(id, buffer, &mut inflate, pack_cache, &mut snapshot, None) + .map_err(|err| Box::new(err) as _) } - fn location_by_oid( - &self, - id: impl AsRef, - buf: &mut Vec, - ) -> Option { + fn location_by_oid(&self, id: &gix_hash::oid, buf: &mut Vec) -> Option { assert!( matches!(self.token.as_ref(), Some(handle::Mode::KeepDeletedPacksAvailable)), "BUG: handle must be configured to `prevent_pack_unload()` before using this method" @@ -362,8 +361,8 @@ where assert!(self.store_ref().replacements.is_empty() || self.ignore_replacements, "Everything related to packing must not use replacements. These are not used here, but it should be turned off for good measure."); - let id = id.as_ref(); let mut snapshot = self.snapshot.borrow_mut(); + let mut inflate = self.inflate.borrow_mut(); 'outer: loop { { let marker = snapshot.marker; @@ -404,13 +403,14 @@ where buf.resize(entry.decompressed_size.try_into().expect("representable size"), 0); assert_eq!(pack.id, pack_id.to_intrinsic_pack_id(), "both ids must always match"); - let res = pack.decompress_entry(&entry, buf).ok().map(|entry_size_past_header| { - gix_pack::data::entry::Location { + let res = pack + .decompress_entry(&entry, &mut inflate, buf) + .ok() + .map(|entry_size_past_header| gix_pack::data::entry::Location { pack_id: pack.id, pack_offset, entry_size: entry.header_size() + entry_size_past_header, - } - }); + }); if idx != 0 { snapshot.indices.swap(0, idx); @@ -503,17 +503,15 @@ where S: Deref + Clone, Self: gix_pack::Find, { - type Error = ::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &gix_hash::oid) -> bool { gix_pack::Find::contains(self, id) } fn try_find<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - ) -> Result>, Self::Error> { + ) -> Result>, crate::find::Error> { gix_pack::Find::try_find(self, id, buffer).map(|t| t.map(|t| t.0)) } } diff --git a/vendor/gix-odb/src/store_impls/dynamic/handle.rs b/vendor/gix-odb/src/store_impls/dynamic/handle.rs index 78efd4451..655bdfa43 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/handle.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/handle.rs @@ -257,6 +257,7 @@ impl super::Store { refresh: RefreshMode::default(), ignore_replacements: false, token: Some(token), + inflate: RefCell::new(Default::default()), snapshot: RefCell::new(self.collect_snapshot()), max_recursion_depth: Self::INITIAL_MAX_RECURSION_DEPTH, packed_object_count: Default::default(), @@ -273,6 +274,7 @@ impl super::Store { refresh: Default::default(), ignore_replacements: false, token: Some(token), + inflate: RefCell::new(Default::default()), snapshot: RefCell::new(self.collect_snapshot()), max_recursion_depth: Self::INITIAL_MAX_RECURSION_DEPTH, packed_object_count: Default::default(), @@ -344,8 +346,8 @@ impl TryFrom<&super::Store> for super::Store { fn try_from(s: &super::Store) -> Result { super::Store::at_opts( - s.path(), - s.replacements(), + s.path().into(), + &mut s.replacements(), crate::store::init::Options { slots: crate::store::init::Slots::Given(s.files.len().try_into().expect("BUG: too many slots")), object_hash: Default::default(), @@ -391,6 +393,7 @@ where } .into() }, + inflate: RefCell::new(Default::default()), snapshot: RefCell::new(self.store.collect_snapshot()), max_recursion_depth: self.max_recursion_depth, packed_object_count: Default::default(), diff --git a/vendor/gix-odb/src/store_impls/dynamic/header.rs b/vendor/gix-odb/src/store_impls/dynamic/header.rs index d29a911f1..05ff7cf64 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/header.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/header.rs @@ -1,3 +1,4 @@ +use gix_features::zlib; use std::ops::Deref; use gix_hash::oid; @@ -15,6 +16,7 @@ where fn try_header_inner<'b>( &'b self, mut id: &'b gix_hash::oid, + inflate: &mut zlib::Inflate, snapshot: &mut load_index::Snapshot, recursion: Option>, ) -> Result, Error> { @@ -71,7 +73,7 @@ where }, }; let entry = pack.entry(pack_offset); - let res = match pack.decode_header(entry, |id| { + let res = match pack.decode_header(entry, inflate, &|id| { index_file.pack_offset_by_id(id).map(|pack_offset| { gix_pack::data::decode::header::ResolvedBase::InPack(pack.entry(pack_offset)) }) @@ -85,9 +87,10 @@ where let hdr = self .try_header_inner( &base_id, + inflate, snapshot, recursion - .map(|r| r.inc_depth()) + .map(DeltaBaseRecursion::inc_depth) .or_else(|| DeltaBaseRecursion::new(id).into()), ) .map_err(|err| Error::DeltaBaseLookup { @@ -127,7 +130,7 @@ where .as_ref() .expect("pack to still be available like just now"); let entry = pack.entry(pack_offset); - pack.decode_header(entry, |id| { + pack.decode_header(entry, inflate, &|id| { index_file .pack_offset_by_id(id) .map(|pack_offset| { @@ -179,11 +182,10 @@ impl crate::Header for super::Handle where S: Deref + Clone, { - type Error = Error; - - fn try_header(&self, id: impl AsRef) -> Result, Self::Error> { - let id = id.as_ref(); + fn try_header(&self, id: &oid) -> Result, crate::find::Error> { let mut snapshot = self.snapshot.borrow_mut(); - self.try_header_inner(id, &mut snapshot, None) + let mut inflate = self.inflate.borrow_mut(); + self.try_header_inner(id, &mut inflate, &mut snapshot, None) + .map_err(|err| Box::new(err) as _) } } diff --git a/vendor/gix-odb/src/store_impls/dynamic/init.rs b/vendor/gix-odb/src/store_impls/dynamic/init.rs index 5e272dcff..d7e1d9d99 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/init.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/init.rs @@ -70,8 +70,8 @@ impl Store { /// `replacements` is an iterator over pairs of old and new object ids for replacement support. /// This means that when asking for object `X`, one will receive object `X-replaced` given an iterator like `Some((X, X-replaced))`. pub fn at_opts( - objects_dir: impl Into, - replacements: impl IntoIterator, + objects_dir: PathBuf, + replacements: &mut dyn Iterator, Options { slots, object_hash, @@ -79,7 +79,7 @@ impl Store { current_dir, }: Options, ) -> std::io::Result { - let objects_dir = objects_dir.into(); + let _span = gix_features::trace::detail!("gix_odb::Store::at()"); let current_dir = current_dir.map_or_else(std::env::current_dir, Ok)?; if !objects_dir.is_dir() { return Err(std::io::Error::new( @@ -90,7 +90,7 @@ impl Store { let slot_count = match slots { Slots::Given(n) => n as usize, Slots::AsNeededByDiskState { multiplier, minimum } => { - let mut db_paths = crate::alternate::resolve(&objects_dir, ¤t_dir) + let mut db_paths = crate::alternate::resolve(objects_dir.clone(), ¤t_dir) .map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err))?; db_paths.insert(0, objects_dir.clone()); let num_slots = super::Store::collect_indices_and_mtime_sorted_by_size(db_paths, None, None) @@ -106,7 +106,7 @@ impl Store { "Cannot use more than 1^15 slots", )); } - let mut replacements: Vec<_> = replacements.into_iter().collect(); + let mut replacements: Vec<_> = replacements.collect(); replacements.sort_by(|a, b| a.0.cmp(&b.0)); Ok(Store { diff --git a/vendor/gix-odb/src/store_impls/dynamic/iter.rs b/vendor/gix-odb/src/store_impls/dynamic/iter.rs index 2152dff71..2a7253aec 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/iter.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/iter.rs @@ -192,7 +192,7 @@ impl Iterator for AllObjects { Some(id) => Some(id), None => { *index += 1; - match self.loose_dbs.get(*index).map(|ldb| ldb.iter()) { + match self.loose_dbs.get(*index).map(loose::Store::iter) { Some(new_iter) => { *iter = new_iter; self.next() diff --git a/vendor/gix-odb/src/store_impls/dynamic/load_index.rs b/vendor/gix-odb/src/store_impls/dynamic/load_index.rs index 84224dff1..4716a5806 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/load_index.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/load_index.rs @@ -206,7 +206,7 @@ impl super::Store { self.num_disk_state_consolidation.fetch_add(1, Ordering::Relaxed); let db_paths: Vec<_> = std::iter::once(objects_directory.to_owned()) - .chain(crate::alternate::resolve(objects_directory, &self.current_dir)?) + .chain(crate::alternate::resolve(objects_directory.clone(), &self.current_dir)?) .collect(); // turn db paths into loose object databases. Reuse what's there, but only if it is in the right order. @@ -470,8 +470,7 @@ impl super::Store { }) .transpose()?; if let Some((multi_index, mtime, flen)) = multi_index_info { - let index_names_in_multi_index: Vec<_> = - multi_index.index_names().iter().map(|p| p.as_path()).collect(); + let index_names_in_multi_index: Vec<_> = multi_index.index_names().iter().map(AsRef::as_ref).collect(); let mut indices_not_in_multi_index: Vec<(Either, _, _)> = indices .into_iter() .filter_map(|(path, a, b)| { @@ -494,6 +493,11 @@ impl super::Store { // Unlike libgit2, do not sort by modification date, but by size and put the biggest indices first. That way // the chance to hit an object should be higher. We leave it to the handle to sort by LRU. // Git itself doesn't change the order which may safe time, but we want it to be stable which also helps some tests. + // NOTE: this will work well for well-packed repos or those using geometric repacking, but force us to open a lot + // of files when dealing with new objects, as there is no notion of recency here as would be with unmaintained + // repositories. Different algorithms should be provided, like newest packs first, and possibly a mix of both + // with big packs first, then sorting by recency for smaller packs. + // We also want to implement `fetch.unpackLimit` to alleviate this issue a little. indices_by_modification_time.sort_by(|l, r| l.2.cmp(&r.2).reverse()); Ok(indices_by_modification_time) } diff --git a/vendor/gix-odb/src/store_impls/dynamic/mod.rs b/vendor/gix-odb/src/store_impls/dynamic/mod.rs index e992fada6..35d4f7ca6 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/mod.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/mod.rs @@ -1,4 +1,5 @@ //! The standard object store which should fit all needs. +use gix_features::zlib; use std::{cell::RefCell, ops::Deref}; use crate::Store; @@ -24,6 +25,7 @@ where pub(crate) token: Option, snapshot: RefCell, + inflate: RefCell, packed_object_count: RefCell>, } diff --git a/vendor/gix-odb/src/store_impls/dynamic/prefix.rs b/vendor/gix-odb/src/store_impls/dynamic/prefix.rs index c0edeba3f..58a49416b 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/prefix.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/prefix.rs @@ -40,13 +40,13 @@ pub mod disambiguate { /// matching this prefix. pub fn new(id: impl Into, hex_len: usize) -> Result { let id = id.into(); - gix_hash::Prefix::new(id, hex_len)?; + gix_hash::Prefix::new(&id, hex_len)?; Ok(Candidate { id, hex_len }) } /// Transform ourselves into a `Prefix` with our current hex lengths. pub fn to_prefix(&self) -> gix_hash::Prefix { - gix_hash::Prefix::new(self.id, self.hex_len).expect("our hex-len to always be in bounds") + gix_hash::Prefix::new(&self.id, self.hex_len).expect("our hex-len to always be in bounds") } pub(crate) fn inc_hex_len(&mut self) { @@ -85,6 +85,7 @@ where match *count { Some(count) => Ok(count), None => { + let _span = gix_features::trace::detail!("gix_odb::Handle::packed_object_count()"); let mut snapshot = self.snapshot.borrow_mut(); *snapshot = self.store.load_all_indices()?; let mut obj_count = 0; diff --git a/vendor/gix-odb/src/store_impls/dynamic/structure.rs b/vendor/gix-odb/src/store_impls/dynamic/structure.rs index 687e74d6a..8e5adc23c 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/structure.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/structure.rs @@ -52,6 +52,7 @@ impl Store { /// implementation. The likelihood of actual changes is low though as these still depend on something /// changing on disk and somebody reading at the same time. pub fn structure(&self) -> Result, load_index::Error> { + let _span = gix_features::trace::detail!("gix_odb::Store::structure()"); let index = self.index.load(); if !index.is_initialized() { self.consolidate_with_disk_state(true, false /*load one new index*/)?; diff --git a/vendor/gix-odb/src/store_impls/dynamic/types.rs b/vendor/gix-odb/src/store_impls/dynamic/types.rs index c77cf2109..473c587bb 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/types.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/types.rs @@ -305,7 +305,7 @@ impl IndexAndPacks { match self { Self::Index(bundle) => bundle.index.is_disposable() || bundle.data.is_disposable(), Self::MultiIndex(bundle) => { - bundle.multi_index.is_disposable() || bundle.data.iter().any(|odf| odf.is_disposable()) + bundle.multi_index.is_disposable() || bundle.data.iter().any(OnDiskFile::is_disposable) } } } diff --git a/vendor/gix-odb/src/store_impls/dynamic/verify.rs b/vendor/gix-odb/src/store_impls/dynamic/verify.rs index 5156074ac..94a916b98 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/verify.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/verify.rs @@ -4,7 +4,7 @@ use std::{ time::Instant, }; -use gix_features::progress::{MessageLevel, Progress}; +use gix_features::progress::{DynNestedProgress, MessageLevel, Progress}; use crate::{ pack, @@ -73,13 +73,11 @@ pub mod integrity { } /// Returned by [`Store::verify_integrity()`][crate::Store::verify_integrity()]. - pub struct Outcome

{ + pub struct Outcome { /// Statistics for validated loose object stores. pub loose_object_stores: Vec, /// Pack traversal statistics for each index and their pack(s) pub index_statistics: Vec, - /// The provided progress instance. - pub progress: P, } /// The progress ids used in [`Store::verify_integrity()`][crate::Store::verify_integrity()]. @@ -111,17 +109,17 @@ impl super::Store { /// /// Note that this will not force loading all indices or packs permanently, as we will only use the momentarily loaded disk state. /// This does, however, include all alternates. - pub fn verify_integrity( + pub fn verify_integrity( &self, - mut progress: P, + progress: &mut dyn DynNestedProgress, should_interrupt: &AtomicBool, options: integrity::Options, - ) -> Result, integrity::Error> + ) -> Result where - P: Progress, C: pack::cache::DecodeEntry, F: Fn() -> C + Send + Clone, { + let _span = gix_features::trace::coarse!("gix_odb:Store::verify_integrity()"); let mut index = self.index.load(); if !index.is_initialized() { self.consolidate_with_disk_state(true, false)?; @@ -141,126 +139,131 @@ impl super::Store { format!( "Checking integrity: {}", path.file_name() - .map_or_else(std::borrow::Cow::default, |f| f.to_string_lossy()) + .map_or_else(Default::default, std::ffi::OsStr::to_string_lossy) ) }; - for slot_index in &index.slot_indices { - let slot = &self.files[*slot_index]; - if slot.generation.load(Ordering::SeqCst) != index.generation { - return Err(integrity::Error::NeedsRetryDueToChangeOnDisk); - } - let files = slot.files.load(); - let files = Option::as_ref(&files).ok_or(integrity::Error::NeedsRetryDueToChangeOnDisk)?; + gix_features::trace::detail!("verify indices").into_scope(|| { + for slot_index in &index.slot_indices { + let slot = &self.files[*slot_index]; + if slot.generation.load(Ordering::SeqCst) != index.generation { + return Err(integrity::Error::NeedsRetryDueToChangeOnDisk); + } + let files = slot.files.load(); + let files = Option::as_ref(&files).ok_or(integrity::Error::NeedsRetryDueToChangeOnDisk)?; - let start = Instant::now(); - let (mut child_progress, num_objects, index_path) = match files { - IndexAndPacks::Index(bundle) => { - let index; - let index = match bundle.index.loaded() { - Some(index) => index.deref(), - None => { - index = pack::index::File::at(bundle.index.path(), self.object_hash)?; - &index - } - }; - let pack; - let data = match bundle.data.loaded() { - Some(pack) => pack.deref(), - None => { - pack = pack::data::File::at(bundle.data.path(), self.object_hash)?; - &pack - } - }; - let outcome = index.verify_integrity( - Some(pack::index::verify::PackContext { - data, - options: options.clone(), - }), - progress.add_child_with_id( - "verify index", + let start = Instant::now(); + let (mut child_progress, num_objects, index_path) = match files { + IndexAndPacks::Index(bundle) => { + let index; + let index = match bundle.index.loaded() { + Some(index) => index.deref(), + None => { + index = pack::index::File::at(bundle.index.path(), self.object_hash)?; + &index + } + }; + let pack; + let data = match bundle.data.loaded() { + Some(pack) => pack.deref(), + None => { + pack = pack::data::File::at(bundle.data.path(), self.object_hash)?; + &pack + } + }; + let mut child_progress = progress.add_child_with_id( + "verify index".into(), integrity::ProgressId::VerifyIndex(Default::default()).into(), - ), - should_interrupt, - )?; - statistics.push(IndexStatistics { - path: bundle.index.path().to_owned(), - statistics: SingleOrMultiStatistics::Single( - outcome - .pack_traverse_statistics - .expect("pack provided so there are stats"), - ), - }); - (outcome.progress, index.num_objects(), index.path().to_owned()) - } - IndexAndPacks::MultiIndex(bundle) => { - let index; - let index = match bundle.multi_index.loaded() { - Some(index) => index.deref(), - None => { - index = pack::multi_index::File::at(bundle.multi_index.path())?; - &index - } - }; - let outcome = index.verify_integrity( - progress.add_child_with_id( - "verify multi-index", + ); + let outcome = index.verify_integrity( + Some(pack::index::verify::PackContext { + data, + options: options.clone(), + }), + &mut child_progress, + should_interrupt, + )?; + statistics.push(IndexStatistics { + path: bundle.index.path().to_owned(), + statistics: SingleOrMultiStatistics::Single( + outcome + .pack_traverse_statistics + .expect("pack provided so there are stats"), + ), + }); + (child_progress, index.num_objects(), index.path().to_owned()) + } + IndexAndPacks::MultiIndex(bundle) => { + let index; + let index = match bundle.multi_index.loaded() { + Some(index) => index.deref(), + None => { + index = pack::multi_index::File::at(bundle.multi_index.path())?; + &index + } + }; + let mut child_progress = progress.add_child_with_id( + "verify multi-index".into(), integrity::ProgressId::VerifyMultiIndex(Default::default()).into(), - ), - should_interrupt, - options.clone(), - )?; + ); + let outcome = index.verify_integrity(&mut child_progress, should_interrupt, options.clone())?; - let index_dir = bundle.multi_index.path().parent().expect("file in a directory"); - statistics.push(IndexStatistics { - path: Default::default(), - statistics: SingleOrMultiStatistics::Multi( - outcome - .pack_traverse_statistics - .into_iter() - .zip(index.index_names()) - .map(|(statistics, index_name)| (index_dir.join(index_name), statistics)) - .collect(), - ), - }); - (outcome.progress, index.num_objects(), index.path().to_owned()) - } - }; + let index_dir = bundle.multi_index.path().parent().expect("file in a directory"); + statistics.push(IndexStatistics { + path: Default::default(), + statistics: SingleOrMultiStatistics::Multi( + outcome + .pack_traverse_statistics + .into_iter() + .zip(index.index_names()) + .map(|(statistics, index_name)| (index_dir.join(index_name), statistics)) + .collect(), + ), + }); + (child_progress, index.num_objects(), index.path().to_owned()) + } + }; - child_progress.set_name(index_check_message(&index_path)); - child_progress.show_throughput_with( - start, - num_objects as usize, - gix_features::progress::count("objects").expect("set"), - MessageLevel::Success, - ); - progress.inc(); - } + child_progress.set_name(index_check_message(&index_path)); + child_progress.show_throughput_with( + start, + num_objects as usize, + gix_features::progress::count("objects").expect("set"), + MessageLevel::Success, + ); + progress.inc(); + } + Ok(()) + })?; progress.init( Some(index.loose_dbs.len()), gix_features::progress::count("loose object stores"), ); let mut loose_object_stores = Vec::new(); - for loose_db in &*index.loose_dbs { - let out = loose_db - .verify_integrity( - progress.add_child_with_id( - loose_db.path().display().to_string(), - integrity::ProgressId::VerifyLooseObjectDbPath.into(), - ), - should_interrupt, - ) - .map(|statistics| integrity::LooseObjectStatistics { - path: loose_db.path().to_owned(), - statistics, - })?; - loose_object_stores.push(out); - } + gix_features::trace::detail!("verify loose ODBs").into_scope( + || -> Result<_, crate::loose::verify::integrity::Error> { + for loose_db in &*index.loose_dbs { + let out = loose_db + .verify_integrity( + &mut progress.add_child_with_id( + loose_db.path().display().to_string(), + integrity::ProgressId::VerifyLooseObjectDbPath.into(), + ), + should_interrupt, + ) + .map(|statistics| integrity::LooseObjectStatistics { + path: loose_db.path().to_owned(), + statistics, + })?; + loose_object_stores.push(out); + } + Ok(()) + }, + )?; Ok(integrity::Outcome { loose_object_stores, index_statistics: statistics, - progress, }) } } diff --git a/vendor/gix-odb/src/store_impls/dynamic/write.rs b/vendor/gix-odb/src/store_impls/dynamic/write.rs index a2e40eec4..ba615f351 100644 --- a/vendor/gix-odb/src/store_impls/dynamic/write.rs +++ b/vendor/gix-odb/src/store_impls/dynamic/write.rs @@ -28,16 +28,15 @@ impl crate::Write for store::Handle where S: Deref + Clone, { - type Error = Error; - - fn write_stream(&self, kind: Kind, size: u64, from: impl Read) -> Result { + fn write_stream(&self, kind: Kind, size: u64, from: &mut dyn Read) -> Result { let mut snapshot = self.snapshot.borrow_mut(); Ok(match snapshot.loose_dbs.first() { Some(ldb) => ldb.write_stream(kind, size, from)?, None => { let new_snapshot = self .store - .load_one_index(self.refresh, snapshot.marker)? + .load_one_index(self.refresh, snapshot.marker) + .map_err(Box::new)? .expect("there is always at least one ODB, and this code runs only once for initialization"); *snapshot = new_snapshot; snapshot.loose_dbs[0].write_stream(kind, size, from)? diff --git a/vendor/gix-odb/src/store_impls/loose/find.rs b/vendor/gix-odb/src/store_impls/loose/find.rs index 04fabe61b..91bf0ba87 100644 --- a/vendor/gix-odb/src/store_impls/loose/find.rs +++ b/vendor/gix-odb/src/store_impls/loose/find.rs @@ -34,9 +34,9 @@ impl Store { const OPEN_ACTION: &'static str = "open"; /// Returns true if the given id is contained in our repository. - pub fn contains(&self, id: impl AsRef) -> bool { - debug_assert_eq!(self.object_hash, id.as_ref().kind()); - hash_path(id.as_ref(), self.path.clone()).is_file() + pub fn contains(&self, id: &gix_hash::oid) -> bool { + debug_assert_eq!(self.object_hash, id.kind()); + hash_path(id, self.path.clone()).is_file() } /// Given a `prefix`, find an object that matches it uniquely within this loose object @@ -56,7 +56,7 @@ impl Store { ) -> Result, crate::loose::iter::Error> { let single_directory_iter = crate::loose::Iter { inner: gix_features::fs::walkdir_new( - self.path.join(prefix.as_oid().to_hex_with_len(2).to_string()), + &self.path.join(prefix.as_oid().to_hex_with_len(2).to_string()), gix_features::fs::walkdir::Parallelism::Serial, ) .min_depth(1) @@ -108,11 +108,11 @@ impl Store { /// there was no such object. pub fn try_find<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, out: &'a mut Vec, ) -> Result>, Error> { - debug_assert_eq!(self.object_hash, id.as_ref().kind()); - match self.find_inner(id.as_ref(), out) { + debug_assert_eq!(self.object_hash, id.kind()); + match self.find_inner(id, out) { Ok(obj) => Ok(Some(obj)), Err(err) => match err { Error::Io { @@ -137,10 +137,10 @@ impl Store { /// Return only the decompressed size of the object and its kind without fully reading it into memory as tuple of `(size, kind)`. /// Returns `None` if `id` does not exist in the database. - pub fn try_header(&self, id: impl AsRef) -> Result, Error> { + pub fn try_header(&self, id: &gix_hash::oid) -> Result, Error> { const BUF_SIZE: usize = 256; let mut buf = [0_u8; BUF_SIZE]; - let path = hash_path(id.as_ref(), self.path.clone()); + let path = hash_path(id, self.path.clone()); let mut inflate = zlib::Inflate::default(); let mut istream = match fs::File::open(&path) { diff --git a/vendor/gix-odb/src/store_impls/loose/verify.rs b/vendor/gix-odb/src/store_impls/loose/verify.rs index 8ffbb7105..ae83c1d01 100644 --- a/vendor/gix-odb/src/store_impls/loose/verify.rs +++ b/vendor/gix-odb/src/store_impls/loose/verify.rs @@ -3,7 +3,7 @@ use std::{ time::Instant, }; -use gix_features::progress::Progress; +use gix_features::progress::{Count, DynNestedProgress, Progress}; use crate::{loose::Store, Write}; @@ -61,7 +61,7 @@ impl Store { /// Check all loose objects for their integrity checking their hash matches the actual data and by decoding them fully. pub fn verify_integrity( &self, - mut progress: impl Progress, + progress: &mut dyn DynNestedProgress, should_interrupt: &AtomicBool, ) -> Result { let mut buf = Vec::new(); @@ -69,11 +69,11 @@ impl Store { let mut num_objects = 0; let start = Instant::now(); - let mut progress = progress.add_child_with_id("Validating", integrity::ProgressId::LooseObjects.into()); + let mut progress = progress.add_child_with_id("Validating".into(), integrity::ProgressId::LooseObjects.into()); progress.init(None, gix_features::progress::count("loose objects")); for id in self.iter().filter_map(Result::ok) { let object = self - .try_find(id, &mut buf) + .try_find(&id, &mut buf) .map_err(|_| integrity::Error::Retry)? .ok_or(integrity::Error::Retry)?; let actual_id = sink.write_buf(object.kind, object.data).expect("sink never fails"); diff --git a/vendor/gix-odb/src/store_impls/loose/write.rs b/vendor/gix-odb/src/store_impls/loose/write.rs index 912426bba..e537eda92 100644 --- a/vendor/gix-odb/src/store_impls/loose/write.rs +++ b/vendor/gix-odb/src/store_impls/loose/write.rs @@ -27,9 +27,7 @@ pub enum Error { } impl crate::traits::Write for Store { - type Error = Error; - - fn write(&self, object: impl WriteTo) -> Result { + fn write(&self, object: &dyn WriteTo) -> Result { let mut to = self.dest()?; to.write_all(&object.loose_header()).map_err(|err| Error::Io { source: err, @@ -41,15 +39,15 @@ impl crate::traits::Write for Store { message: "stream all data into tempfile in", path: self.path.to_owned(), })?; - to.flush()?; - self.finalize_object(to) + to.flush().map_err(Box::new)?; + Ok(self.finalize_object(to).map_err(Box::new)?) } /// Write the given buffer in `from` to disk in one syscall at best. /// /// This will cost at least 4 IO operations. - fn write_buf(&self, kind: gix_object::Kind, from: &[u8]) -> Result { - let mut to = self.dest()?; + fn write_buf(&self, kind: gix_object::Kind, from: &[u8]) -> Result { + let mut to = self.dest().map_err(Box::new)?; to.write_all(&gix_object::encode::loose_header(kind, from.len())) .map_err(|err| Error::Io { source: err, @@ -63,7 +61,7 @@ impl crate::traits::Write for Store { path: self.path.to_owned(), })?; to.flush()?; - self.finalize_object(to) + Ok(self.finalize_object(to)?) } /// Write the given stream in `from` to disk with at least one syscall. @@ -73,9 +71,9 @@ impl crate::traits::Write for Store { &self, kind: gix_object::Kind, size: u64, - mut from: impl io::Read, - ) -> Result { - let mut to = self.dest()?; + mut from: &mut dyn io::Read, + ) -> Result { + let mut to = self.dest().map_err(Box::new)?; to.write_all(&gix_object::encode::loose_header( kind, size.try_into().expect("object size to fit into usize"), @@ -86,13 +84,15 @@ impl crate::traits::Write for Store { path: self.path.to_owned(), })?; - io::copy(&mut from, &mut to).map_err(|err| Error::Io { - source: err, - message: "stream all data into tempfile in", - path: self.path.to_owned(), - })?; - to.flush()?; - self.finalize_object(to) + io::copy(&mut from, &mut to) + .map_err(|err| Error::Io { + source: err, + message: "stream all data into tempfile in", + path: self.path.to_owned(), + }) + .map_err(Box::new)?; + to.flush().map_err(Box::new)?; + Ok(self.finalize_object(to)?) } } diff --git a/vendor/gix-odb/src/traits.rs b/vendor/gix-odb/src/traits.rs index ddec78b8e..91d66c42d 100644 --- a/vendor/gix-odb/src/traits.rs +++ b/vendor/gix-odb/src/traits.rs @@ -4,21 +4,16 @@ use gix_object::WriteTo; /// Describe the capability to write git objects into an object store. pub trait Write { - /// The error type used for all trait methods. - /// - /// _Note_ the default implementations require the `From` bound. - type Error: std::error::Error + From; - /// Write objects using the intrinsic kind of [`hash`][gix_hash::Kind] into the database, /// returning id to reference it in subsequent reads. - fn write(&self, object: impl WriteTo) -> Result { + fn write(&self, object: &dyn WriteTo) -> Result { let mut buf = Vec::with_capacity(2048); object.write_to(&mut buf)?; - self.write_stream(object.kind(), buf.len() as u64, buf.as_slice()) + self.write_stream(object.kind(), buf.len() as u64, &mut buf.as_slice()) } /// As [`write`][Write::write], but takes an [`object` kind][gix_object::Kind] along with its encoded bytes. - fn write_buf(&self, object: gix_object::Kind, from: &[u8]) -> Result { - self.write_stream(object, from.len() as u64, from) + fn write_buf(&self, object: gix_object::Kind, mut from: &[u8]) -> Result { + self.write_stream(object, from.len() as u64, &mut from) } /// As [`write`][Write::write], but takes an input stream. /// This is commonly used for writing blobs directly without reading them to memory first. @@ -26,8 +21,8 @@ pub trait Write { &self, kind: gix_object::Kind, size: u64, - from: impl io::Read, - ) -> Result; + from: &mut dyn io::Read, + ) -> Result; } /// Describe how object can be located in an object store. @@ -39,11 +34,8 @@ pub trait Write { /// /// [issue]: https://github.com/rust-lang/rust/issues/44265 pub trait Find { - /// The error returned by [`try_find()`][Find::try_find()] - type Error: std::error::Error + 'static; - /// Returns true if the object exists in the database. - fn contains(&self, id: impl AsRef) -> bool; + fn contains(&self, id: &gix_hash::oid) -> bool; /// Find an object matching `id` in the database while placing its raw, possibly encoded data into `buffer`. /// @@ -51,17 +43,15 @@ pub trait Find { /// retrieval. fn try_find<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - ) -> Result>, Self::Error>; + ) -> Result>, find::Error>; } /// A way to obtain object properties without fully decoding it. pub trait Header { - /// The error returned by [`try_header()`][Header::try_header()]. - type Error: std::error::Error + 'static; /// Try to read the header of the object associated with `id` or return `None` if it could not be found. - fn try_header(&self, id: impl AsRef) -> Result, Self::Error>; + fn try_header(&self, id: &gix_hash::oid) -> Result, find::Error>; } mod _impls { @@ -76,17 +66,15 @@ mod _impls { where T: crate::Write, { - type Error = T::Error; - - fn write(&self, object: impl WriteTo) -> Result { + fn write(&self, object: &dyn WriteTo) -> Result { (*self).write(object) } - fn write_buf(&self, object: Kind, from: &[u8]) -> Result { + fn write_buf(&self, object: Kind, from: &[u8]) -> Result { (*self).write_buf(object, from) } - fn write_stream(&self, kind: Kind, size: u64, from: impl Read) -> Result { + fn write_stream(&self, kind: Kind, size: u64, from: &mut dyn Read) -> Result { (*self).write_stream(kind, size, from) } } @@ -95,17 +83,15 @@ mod _impls { where T: crate::Write, { - type Error = T::Error; - - fn write(&self, object: impl WriteTo) -> Result { + fn write(&self, object: &dyn WriteTo) -> Result { self.deref().write(object) } - fn write_buf(&self, object: Kind, from: &[u8]) -> Result { + fn write_buf(&self, object: Kind, from: &[u8]) -> Result { self.deref().write_buf(object, from) } - fn write_stream(&self, kind: Kind, size: u64, from: impl Read) -> Result { + fn write_stream(&self, kind: Kind, size: u64, from: &mut dyn Read) -> Result { self.deref().write_stream(kind, size, from) } } @@ -114,17 +100,15 @@ mod _impls { where T: crate::Write, { - type Error = T::Error; - - fn write(&self, object: impl WriteTo) -> Result { + fn write(&self, object: &dyn WriteTo) -> Result { self.deref().write(object) } - fn write_buf(&self, object: Kind, from: &[u8]) -> Result { + fn write_buf(&self, object: Kind, from: &[u8]) -> Result { self.deref().write_buf(object, from) } - fn write_stream(&self, kind: Kind, size: u64, from: impl Read) -> Result { + fn write_stream(&self, kind: Kind, size: u64, from: &mut dyn Read) -> Result { self.deref().write_stream(kind, size, from) } } @@ -133,13 +117,11 @@ mod _impls { where T: crate::Find, { - type Error = T::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &oid) -> bool { (*self).contains(id) } - fn try_find<'a>(&self, id: impl AsRef, buffer: &'a mut Vec) -> Result>, Self::Error> { + fn try_find<'a>(&self, id: &oid, buffer: &'a mut Vec) -> Result>, crate::find::Error> { (*self).try_find(id, buffer) } } @@ -148,9 +130,7 @@ mod _impls { where T: crate::Header, { - type Error = T::Error; - - fn try_header(&self, id: impl AsRef) -> Result, Self::Error> { + fn try_header(&self, id: &oid) -> Result, crate::find::Error> { (*self).try_header(id) } } @@ -159,13 +139,11 @@ mod _impls { where T: crate::Find, { - type Error = T::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &oid) -> bool { self.deref().contains(id) } - fn try_find<'a>(&self, id: impl AsRef, buffer: &'a mut Vec) -> Result>, Self::Error> { + fn try_find<'a>(&self, id: &oid, buffer: &'a mut Vec) -> Result>, crate::find::Error> { self.deref().try_find(id, buffer) } } @@ -174,9 +152,7 @@ mod _impls { where T: crate::Header, { - type Error = T::Error; - - fn try_header(&self, id: impl AsRef) -> Result, Self::Error> { + fn try_header(&self, id: &oid) -> Result, crate::find::Error> { self.deref().try_header(id) } } @@ -185,13 +161,11 @@ mod _impls { where T: crate::Find, { - type Error = T::Error; - - fn contains(&self, id: impl AsRef) -> bool { + fn contains(&self, id: &oid) -> bool { self.deref().contains(id) } - fn try_find<'a>(&self, id: impl AsRef, buffer: &'a mut Vec) -> Result>, Self::Error> { + fn try_find<'a>(&self, id: &oid, buffer: &'a mut Vec) -> Result>, crate::find::Error> { self.deref().try_find(id, buffer) } } @@ -200,9 +174,7 @@ mod _impls { where T: crate::Header, { - type Error = T::Error; - - fn try_header(&self, id: impl AsRef) -> Result, Self::Error> { + fn try_header(&self, id: &oid) -> Result, crate::find::Error> { self.deref().try_header(id) } } @@ -219,10 +191,9 @@ mod ext { /// while returning the desired object type. fn $method<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - ) -> Result<$object_type, find::existing_object::Error> { - let id = id.as_ref(); + ) -> Result<$object_type, find::existing_object::Error> { self.try_find(id, buffer) .map_err(find::existing_object::Error::Find)? .ok_or_else(|| find::existing_object::Error::NotFound { @@ -245,10 +216,9 @@ mod ext { /// while returning the desired iterator type. fn $method<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - ) -> Result<$object_type, find::existing_iter::Error> { - let id = id.as_ref(); + ) -> Result<$object_type, find::existing_iter::Error> { self.try_find(id, buffer) .map_err(find::existing_iter::Error::Find)? .ok_or_else(|| find::existing_iter::Error::NotFound { @@ -267,10 +237,7 @@ mod ext { /// An extension trait with convenience functions. pub trait HeaderExt: super::Header { /// Like [`try_header(…)`][super::Header::try_header()], but flattens the `Result>` into a single `Result` making a non-existing object an error. - fn header( - &self, - id: impl AsRef, - ) -> Result> { + fn header(&self, id: impl AsRef) -> Result { let id = id.as_ref(); self.try_header(id) .map_err(find::existing::Error::Find)? @@ -285,10 +252,9 @@ mod ext { /// Like [`try_find(…)`][super::Find::try_find()], but flattens the `Result>` into a single `Result` making a non-existing object an error. fn find<'a>( &self, - id: impl AsRef, + id: &gix_hash::oid, buffer: &'a mut Vec, - ) -> Result, find::existing::Error> { - let id = id.as_ref(); + ) -> Result, find::existing::Error> { self.try_find(id, buffer) .map_err(find::existing::Error::Find)? .ok_or_else(|| find::existing::Error::NotFound { oid: id.to_owned() }) -- cgit v1.2.3