summaryrefslogtreecommitdiffstats
path: root/vendor/gix-worktree
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-worktree
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-worktree')
-rw-r--r--vendor/gix-worktree/.cargo-checksum.json2
-rw-r--r--vendor/gix-worktree/CHANGELOG.md523
-rw-r--r--vendor/gix-worktree/Cargo.toml62
-rw-r--r--vendor/gix-worktree/src/checkout/chunk.rs182
-rw-r--r--vendor/gix-worktree/src/checkout/entry.rs166
-rw-r--r--vendor/gix-worktree/src/checkout/function.rs119
-rw-r--r--vendor/gix-worktree/src/checkout/mod.rs77
-rw-r--r--vendor/gix-worktree/src/lib.rs18
-rw-r--r--vendor/gix-worktree/src/read.rs64
-rw-r--r--vendor/gix-worktree/src/stack/delegate.rs (renamed from vendor/gix-worktree/src/cache/delegate.rs)74
-rw-r--r--vendor/gix-worktree/src/stack/mod.rs (renamed from vendor/gix-worktree/src/cache/mod.rs)39
-rw-r--r--vendor/gix-worktree/src/stack/platform.rs (renamed from vendor/gix-worktree/src/cache/platform.rs)5
-rw-r--r--vendor/gix-worktree/src/stack/state/attributes.rs (renamed from vendor/gix-worktree/src/cache/state/attributes.rs)70
-rw-r--r--vendor/gix-worktree/src/stack/state/ignore.rs (renamed from vendor/gix-worktree/src/cache/state/ignore.rs)29
-rw-r--r--vendor/gix-worktree/src/stack/state/mod.rs (renamed from vendor/gix-worktree/src/cache/state/mod.rs)47
-rw-r--r--vendor/gix-worktree/src/status/content.rs80
-rw-r--r--vendor/gix-worktree/src/status/function.rs331
-rw-r--r--vendor/gix-worktree/src/status/mod.rs11
-rw-r--r--vendor/gix-worktree/src/status/recorder.rs27
-rw-r--r--vendor/gix-worktree/src/status/types.rs69
-rw-r--r--vendor/gix-worktree/src/untracked.rs1
21 files changed, 586 insertions, 1410 deletions
diff --git a/vendor/gix-worktree/.cargo-checksum.json b/vendor/gix-worktree/.cargo-checksum.json
index baf77ccc9..6f3364629 100644
--- a/vendor/gix-worktree/.cargo-checksum.json
+++ b/vendor/gix-worktree/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"d8a3fe8f16e0c029cc4bb5fc046f4b1b17e49c73857f5e45e2d006b9fdb18fc4","Cargo.toml":"5e7c731a66fed2492bce8790968c256e69563aba10e954194aa316ef6e7ce590","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/cache/delegate.rs":"5b9793d02bdbcb077a3db94996693f5edbf5edb2e085237d6ff602b66338c71b","src/cache/mod.rs":"9da4817fa837f19acd7aa4c05282a35df15136e34073d7a185b9576f913a94c7","src/cache/platform.rs":"f739417a3a24b09f4a2cf019b90969e364297949ec62336dbe2dd6f08f65f48f","src/cache/state/attributes.rs":"443c2a200bf5f4f25c0a9b84c01162852b3d49b9d39579e4fc84c861f0468daf","src/cache/state/ignore.rs":"9541c18bca1865fb415fa9b9af3b93122f9d1d9361fab4f4ccd8f246c3bddab4","src/cache/state/mod.rs":"4d277e93f9625f22fa6d30833cac893f5f616d32ec544a11b2adc02c91fcf78c","src/checkout/chunk.rs":"e18fd36b727b3de9d385b4796723a9c4fabe5bc74d1542cf18b286130860740f","src/checkout/entry.rs":"ecf10061bee108639e75e43a48ec75c0db6c90b111ff049107fdc30f1bbc42fe","src/checkout/function.rs":"c4e5ead2aed452992d7302337f6c941743becdf41b2b10c085f961db96165e3f","src/checkout/mod.rs":"b7846f3ebca425cc1906a94350435df6954c7311fe46645afdd94e06a9de671e","src/lib.rs":"f2950e3100f422833bf2f4a502cb43f24f2d1bfb71147890c9049e2af52ed48d","src/read.rs":"811c526cce324f48490f3cc5ec6c1d91a69e719892150c94b51f435d5c67b23b","src/status/content.rs":"f8571691efc9969062e76b329bf1353e732a6c5d388ef54578b0af7e6fc6e411","src/status/function.rs":"55075f94ea316986c49ba5f7cbf0d261d80d725553755825c485d567b0b71e83","src/status/mod.rs":"6845226e21ea9f370a16e750430ed7760858b1181aa1c2f68b639699cf6a2fed","src/status/recorder.rs":"0d84b3b6ed34c2bd390bdfc4dcf724ddfeef5d9ce7123d5321be3a8036b7b9cd","src/status/types.rs":"5b57d4bffe19d5c48f6bfac14d4b632210c6d87ded83f42125bd0b3af4b8260e","src/untracked.rs":"908bd5d7330ef484c5a20d35f90fc1ccf687c4f56538b77d6899c081861e6a81"},"package":"d388ad962e8854402734a7387af8790f6bdbc8d05349052dab16ca4a0def50f6"} \ No newline at end of file
+{"files":{"CHANGELOG.md":"3371d15a605196c4184b9f1091271e1dcbd15bacb24bdffaccf018f5036f9b04","Cargo.toml":"1627d1b359c58caa675f7098a8e2276d9f5563bfd36a5fa315ee7a0ec1ddacfe","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/lib.rs":"05c141d039a666eb2c16fe9ca3169ea05eaa345dcb0e177760259b4af3442852","src/stack/delegate.rs":"62c099bf3cff362844b2306d8d3b2abdb7db5224c8975d8a19f77b62d81e49fb","src/stack/mod.rs":"31fcc73e73a7b39515422a6d057acd7d2fcba70301ee736041430eeb1d327b5f","src/stack/platform.rs":"08826af920e873d8495d844b57286428b79d954eda0acc05181b469e953b28ff","src/stack/state/attributes.rs":"4fb3aaa51bd60e2d38e86b901cead2d8085b2dc12866e2061a9ba37a5d36275c","src/stack/state/ignore.rs":"93affcabaf9bd0c23d047b7fbaca45a7bfa0522064c45127e07079a26f894c51","src/stack/state/mod.rs":"af9a438581392c6334f642b4fc4c8da5d76d691e4c7eeb7d5447504256369e60"},"package":"9f5e32972801bd82d56609e6fc84efc358fa1f11f25c5e83b7807ee2280f14fe"} \ No newline at end of file
diff --git a/vendor/gix-worktree/CHANGELOG.md b/vendor/gix-worktree/CHANGELOG.md
index d3952e75b..de794b02c 100644
--- a/vendor/gix-worktree/CHANGELOG.md
+++ b/vendor/gix-worktree/CHANGELOG.md
@@ -5,7 +5,355 @@ 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.18.0 (2023-06-06)
+## 0.26.0 (2023-09-24)
+
+A maintenance release without user-facing changes.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 1 commit contributed to the release.
+ - 15 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **Uncategorized**
+ - Prepare changelogs prior to release ([`8a60d5b`](https://github.com/Byron/gitoxide/commit/8a60d5b80877c213c3b646d3061e8a33e0e433ec))
+</details>
+
+## 0.25.0 (2023-09-08)
+
+### New Features
+
+ - <csr-id-477a1d9089d831cd9ed81f109fc2c89333026965/> add `attributes` feature to allow ignore-only stacks.
+
+### Bug Fixes (BREAKING)
+
+ - <csr-id-072ee32f693a31161cd6a843da6582d13efbb20b/> use `dyn` trait where possible.
+ This reduces compile time due to avoiding duplication.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 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
+
+### Commit Details
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **Uncategorized**
+ - Release 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 ([`1ff3064`](https://github.com/Byron/gitoxide/commit/1ff30641b8724efd6699d8bef5c71d28454e98b9))
+ - 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))
+ - Add `attributes` feature to allow ignore-only stacks. ([`477a1d9`](https://github.com/Byron/gitoxide/commit/477a1d9089d831cd9ed81f109fc2c89333026965))
+ - 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))
+ - Merge branch 'adjustments-for-cargo' ([`b7560a2`](https://github.com/Byron/gitoxide/commit/b7560a2445b62f888bf5aa2ba4c5a47ae037cb23))
+ - Release gix-index v0.23.1 ([`11b9c71`](https://github.com/Byron/gitoxide/commit/11b9c71311df978ebb20cca0d765cf249c8eedcf))
+ - Release gix-date v0.7.4, gix-index v0.23.0, safety bump 5 crates ([`3be2b1c`](https://github.com/Byron/gitoxide/commit/3be2b1ccfe30eeae45711c64b88efc522a2b51b7))
+ - Merge branch 'fixes' ([`4bfd1cc`](https://github.com/Byron/gitoxide/commit/4bfd1cc8f7922a8c4de6b9d078d54b93e78f51ff))
+ - Adapt to changes in `gix-index` and pass skip-hash through for performance.. ([`713cd59`](https://github.com/Byron/gitoxide/commit/713cd59f0b1eff6397b80f1e1fceec278532fd59))
+ - Merge branch 'gix-submodule' ([`363ee77`](https://github.com/Byron/gitoxide/commit/363ee77400805f473c9ad66eadad9214e7ab66f4))
+</details>
+
+## 0.24.0 (2023-08-22)
+
+<csr-id-93feea269eebd114e866e6f29f4a73c0096df9e0/>
+<csr-id-229bd4899213f749a7cc124aa2b82a1368fba40f/>
+<csr-id-1958dffc164e7b60ddc2eb308ed6da74a80559df/>
+
+### Chore
+
+ - <csr-id-93feea269eebd114e866e6f29f4a73c0096df9e0/> split tests off into their own crate to allow feature toggles.
+ That way we can test with the `parallel` feature and won't have to
+ create bogus feature toggles that are only used for testing, yet visbible
+ to users.
+ - <csr-id-229bd4899213f749a7cc124aa2b82a1368fba40f/> don't call crate 'WIP' in manifest anymore.
+
+### New Features
+
+ - <csr-id-a7c088015282533f6afbca28ee64cceeca75be35/> add `cache::state::attributes|ignore::Source::adjust_for_bare()` to use non-worktree versions of source easily.
+ - <csr-id-9a4f81952c5361a0001ad4b7f7647b2539edeab1/> `Cache::set_case()` to allow changing the case for each match.
+ This makes it possible to adjust case-sensitivity in case of pathspecs for instance,
+ which require this to be adjustable.
+
+### Changed (BREAKING)
+
+ - <csr-id-5d5f2866e512a4ddad7cb4606913026d2fe62840/> rename `Cache` to `Stack` because it's more fitting.
+
+### Chore (BREAKING)
+
+ - <csr-id-1958dffc164e7b60ddc2eb308ed6da74a80559df/> remove `checkout` and `status` functionality so only `Cache` remains.
+ `gix-worktree` is now a base-crate for use by derived crates that provide additional
+ functionality. Shared types or utilities go here.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 21 commits contributed to the release over the course of 18 calendar days.
+ - 19 days passed between releases.
+ - 6 commits were understood as [conventional](https://www.conventionalcommits.org).
+ - 0 issues like '(#ID)' were seen in commit messages
+
+### Commit Details
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+ - 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))
+ - More cleanup of test crates ([`73c685a`](https://github.com/Byron/gitoxide/commit/73c685a67debcfa26a940f37bbca69cb3a4af57e))
+ - Split tests off into their own crate to allow feature toggles. ([`93feea2`](https://github.com/Byron/gitoxide/commit/93feea269eebd114e866e6f29f4a73c0096df9e0))
+ - Merge branch 'submodule-in-gix' ([`36f7b78`](https://github.com/Byron/gitoxide/commit/36f7b783c67b8a087076a130f5ee9b90b23bc3cc))
+ - Add `cache::state::attributes|ignore::Source::adjust_for_bare()` to use non-worktree versions of source easily. ([`a7c0880`](https://github.com/Byron/gitoxide/commit/a7c088015282533f6afbca28ee64cceeca75be35))
+ - Merge branch 'worktree-organization' ([`8d0d8e0`](https://github.com/Byron/gitoxide/commit/8d0d8e005d7f11924a6717954d892aae5cec45e7))
+ - Adapt to changes in `gix-worktree` ([`e5717e1`](https://github.com/Byron/gitoxide/commit/e5717e1d12c49285d31a90b03b7f8e9cbc6c1108))
+ - Rename `Cache` to `Stack` because it's more fitting. ([`5d5f286`](https://github.com/Byron/gitoxide/commit/5d5f2866e512a4ddad7cb4606913026d2fe62840))
+ - Remove `checkout` and `status` functionality so only `Cache` remains. ([`1958dff`](https://github.com/Byron/gitoxide/commit/1958dffc164e7b60ddc2eb308ed6da74a80559df))
+ - Create new `gix-status` crate to capture `git-status` like functionality ([`be9af32`](https://github.com/Byron/gitoxide/commit/be9af327c75d693658a2427ee9a711e631a8da7d))
+ - Don't call crate 'WIP' in manifest anymore. ([`229bd48`](https://github.com/Byron/gitoxide/commit/229bd4899213f749a7cc124aa2b82a1368fba40f))
+ - Merge branch 'submodule-active' ([`a3afaa4`](https://github.com/Byron/gitoxide/commit/a3afaa42741616a0f1abeef9b54557e7c2b800cb))
+ - `Cache::set_case()` to allow changing the case for each match. ([`9a4f819`](https://github.com/Byron/gitoxide/commit/9a4f81952c5361a0001ad4b7f7647b2539edeab1))
+ - 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 'limit-git' ([`68d9e80`](https://github.com/Byron/gitoxide/commit/68d9e809d4e746fd7beaddeabd3313d59a4cbdfd))
+ - Improve tests (and maybe more) to assure parallel worktree tests are deterministic ([`4ed84a6`](https://github.com/Byron/gitoxide/commit/4ed84a62ccc335be14b928e57b4880954bdf14a3))
+ - 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))
+</details>
+
+## v0.23.1 (2023-08-02)
+
+### Bug Fixes
+
+ - <csr-id-82ae37d70dc244cdf705d20c617d4b0e6bf3cdbf/> don't panic during checkouts when submodules or sparse directories are encountered.
+ Now we trace instead.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 6 commits contributed to the release.
+ - 10 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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 'EmbarkStudios/main' ([`7611fa4`](https://github.com/Byron/gitoxide/commit/7611fa4872c3fcbe2bf7b20fcb4033df2493d256))
+ - Don't panic during checkouts when submodules or sparse directories are encountered. ([`82ae37d`](https://github.com/Byron/gitoxide/commit/82ae37d70dc244cdf705d20c617d4b0e6bf3cdbf))
+ - Remove todo for submodule checkout ([`a08d851`](https://github.com/Byron/gitoxide/commit/a08d851abd4965ac712db2c9e0263c9c137f9d80))
+</details>
+
+## v0.23.0 (2023-07-22)
+
+### Bug Fixes (BREAKING)
+
+ - <csr-id-68bd71cc0c47b0d86c7cb8fb9fe73a03cf8b52f6/> make it possible to pass information about the directory status when matching attributes.
+ This is significant for archiving operations, even though it's not important when matching attributes
+ otherwise.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 9 commits contributed to the release over the course of 1 calendar day.
+ - 3 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+ - Merge branch 'gix-archive' ([`1dda48b`](https://github.com/Byron/gitoxide/commit/1dda48ba2fccb93ebac00fe3460e923af43c86ce))
+ - Make it possible to pass information about the directory status when matching attributes. ([`68bd71c`](https://github.com/Byron/gitoxide/commit/68bd71cc0c47b0d86c7cb8fb9fe73a03cf8b52f6))
+ - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e))
+</details>
+
+## v0.22.0 (2023-07-19)
+
+### New Features
+
+ - <csr-id-9cd256e91c6c6800b5f6c673285bf08e566f068f/> add `Cache::attributes_metadata()`.
+ A function to obtain the metadata-collection which allows to initialize attribute match
+ initialization in code that can't use the `gix_worktree` crate dependency.
+
+### New Features (BREAKING)
+
+ - <csr-id-29a64c289946301d5e502ee956f3606280409faf/> make it possible to use filter pipeline with streaming for checkouts.
+ This is done by providing a `gix_filter::Pipeline` to `checkout::Options` to control
+ how filters are applied.
+ - <csr-id-9c936755833b10989124f2cce1b675ae7e78af64/> add `cache::State::Attributes` to only load attributes.
+ Even though technically, this isn't really needed, it's required if one wants
+ to support things that git doesn't usually do, like providing conversion of worktree
+ files without a worktree, which can be happening whith `gix-archive` for example.
+
+ As part of this change, `cache::State::id_mappings_from_index()` looses its `ignore` parameter
+ as it wasn't required in the first place.
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 10 commits contributed to the release over the course of 12 calendar days.
+ - 19 days passed between releases.
+ - 3 commits were understood as [conventional](https://www.conventionalcommits.org).
+ - 0 issues like '(#ID)' were seen in commit messages
+
+### Commit Details
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+ - Just fmt ([`a063c62`](https://github.com/Byron/gitoxide/commit/a063c62e3a30006d837b267e2ce74e70e48b4fb6))
+ - Merge branch 'integrate-filtering' ([`b19a56d`](https://github.com/Byron/gitoxide/commit/b19a56dcfa9bea86332a84aa4e8fad445e7d1724))
+ - Make it possible to use filter pipeline with streaming for checkouts. ([`29a64c2`](https://github.com/Byron/gitoxide/commit/29a64c289946301d5e502ee956f3606280409faf))
+ - Assure we run all tests in nextest ([`3821089`](https://github.com/Byron/gitoxide/commit/3821089b6b02c933770705b19fc3126d61beb5a7))
+ - Add `cache::State::Attributes` to only load attributes. ([`9c93675`](https://github.com/Byron/gitoxide/commit/9c936755833b10989124f2cce1b675ae7e78af64))
+ - Add `Cache::attributes_metadata()`. ([`9cd256e`](https://github.com/Byron/gitoxide/commit/9cd256e91c6c6800b5f6c673285bf08e566f068f))
+</details>
+
+## v0.21.1 (2023-06-29)
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+</details>
+
+## v0.21.0 (2023-06-29)
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+</details>
+
+## v0.20.0 (2023-06-22)
+
+<csr-id-bcad5c22049d56a25ef69d6c7a3344e78f9a1d4d/>
+
+### Chore
+
+ - <csr-id-bcad5c22049d56a25ef69d6c7a3344e78f9a1d4d/> Add `clippy::redundant-closure-for-method-calls` lint
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 6 commits contributed to the release over the course of 10 calendar days.
+ - 12 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+ - Merge branch 'corpus' ([`aa16c8c`](https://github.com/Byron/gitoxide/commit/aa16c8ce91452a3e3063cf1cf0240b6014c4743f))
+ - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30))
+ - 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))
+</details>
+
+## v0.19.0 (2023-06-10)
+
+### Commit Statistics
+
+<csr-read-only-do-not-edit/>
+
+ - 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
+
+<csr-read-only-do-not-edit/>
+
+<details><summary>view details</summary>
+
+ * **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))
+</details>
+
+## v0.18.0 (2023-06-06)
### Bug Fixes
@@ -15,7 +363,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<csr-read-only-do-not-edit/>
- - 15 commits contributed to the release over the course of 27 calendar days.
+ - 16 commits contributed to the release over the course of 27 calendar days.
- 37 days passed between releases.
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
- 0 issues like '(#ID)' were seen in commit messages
@@ -27,6 +375,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<details><summary>view details</summary>
* **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))
- `just fmt` ([`ffc1276`](https://github.com/Byron/gitoxide/commit/ffc1276e0c991ac33ce842f5dca0b45ac69680c0))
- Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b))
- Merge branch 'fix-docs' ([`420553a`](https://github.com/Byron/gitoxide/commit/420553a10d780e0b2dc466cac120989298a5f187))
@@ -44,9 +393,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Disallow reading macros when they are not global. ([`c86ca69`](https://github.com/Byron/gitoxide/commit/c86ca69b57cda379fdfe1b4a7af8fabbdfcec28d))
</details>
-## 0.17.1 (2023-04-29)
-
-A maintenance release without user-facing changes.
+## v0.17.1 (2023-04-29)
### Commit Statistics
@@ -69,9 +416,7 @@ A maintenance release without user-facing changes.
- Release gix-index v0.16.1 ([`08c6f9d`](https://github.com/Byron/gitoxide/commit/08c6f9de95c65ff05db4ce6a5593127c4280b2ef))
</details>
-## 0.17.0 (2023-04-27)
-
-A maintenance release without user-facing changes.
+## v0.17.0 (2023-04-27)
### Commit Statistics
@@ -93,7 +438,7 @@ A maintenance release without user-facing changes.
- Bump gix-path v0.8.0, safety bump 20 crates (gix set to 0.44.1 manually) ([`43ebaf2`](https://github.com/Byron/gitoxide/commit/43ebaf267557218865862538ffc7bdf00558492f))
</details>
-## 0.16.0 (2023-04-26)
+## v0.16.0 (2023-04-26)
### New Features
@@ -190,7 +535,7 @@ A maintenance release without user-facing changes.
- Release gix-hash v0.10.4, gix-hashtable v0.1.3 ([`b574a39`](https://github.com/Byron/gitoxide/commit/b574a3904203762a6b9e475e16a7c358d7616599))
</details>
-## 0.15.2 (2023-03-30)
+## v0.15.2 (2023-03-30)
### Documentation
@@ -216,9 +561,7 @@ A maintenance release without user-facing changes.
- Fix minor typos ([`cc48c35`](https://github.com/Byron/gitoxide/commit/cc48c35d0ecf35824910c5b6ecc62fe9b2aff1b5))
</details>
-## 0.15.1 (2023-03-26)
-
-A maintenance release without any user-facing changes.
+## v0.15.1 (2023-03-26)
### Commit Statistics
@@ -242,9 +585,7 @@ A maintenance release without any user-facing changes.
- Merge branch 'fix-cred-helper' ([`01277a6`](https://github.com/Byron/gitoxide/commit/01277a681e4997896e04567490c572b5af606f35))
</details>
-## 0.15.0 (2023-03-10)
-
-A maintenance release without user-facing changes.
+## v0.15.0 (2023-03-10)
### Commit Statistics
@@ -266,9 +607,7 @@ A maintenance release without user-facing changes.
- Prepare changelogs prior to release ([`e06f5f5`](https://github.com/Byron/gitoxide/commit/e06f5f523e83f4da390eddbebcb9a2d58674587b))
</details>
-## 0.14.0 (2023-03-04)
-
-A maintenance release without user-facing changes.
+## v0.14.0 (2023-03-04)
### Commit Statistics
@@ -291,9 +630,7 @@ A maintenance release without user-facing changes.
- Release gix-features v0.28.0, gix-actor v0.19.0, gix-object v0.28.0, gix-diff v0.28.0, gix-traverse v0.24.0, gix-pack v0.32.0, safety bump 20 crates ([`0f411e9`](https://github.com/Byron/gitoxide/commit/0f411e93ec812592bb9d3a52b751399dd86f76f7))
</details>
-## 0.13.0 (2023-03-01)
-
-A maintenance release without user-facing changes.
+## v0.13.0 (2023-03-01)
### Commit Statistics
@@ -318,7 +655,7 @@ A maintenance release without user-facing changes.
- Prepare for git-tempfile release ([`56c005b`](https://github.com/Byron/gitoxide/commit/56c005b13c44376f71e61781e73c0bf93416d0e4))
</details>
-## 0.12.3 (2023-02-20)
+## v0.12.3 (2023-02-20)
### Bug Fixes
@@ -348,44 +685,44 @@ A maintenance release without user-facing changes.
- Release gix-glob v0.5.4 ([`c56d336`](https://github.com/Byron/gitoxide/commit/c56d3365fde21120cf6101cf34f8b5669804977c))
</details>
-## 0.12.2 (2023-02-17)
+## v0.12.2 (2023-02-17)
<csr-id-f7f136dbe4f86e7dee1d54835c420ec07c96cd78/>
<csr-id-533e887e80c5f7ede8392884562e1c5ba56fb9a8/>
-### New Features (BREAKING)
+### Chore
- - <csr-id-3d8fa8fef9800b1576beab8a5bc39b821157a5ed/> upgrade edition to 2021 in most crates.
- MSRV for this is 1.56, and we are now at 1.60 so should be compatible.
- This isn't more than a patch release as it should break nobody
- who is adhering to the MSRV, but let's be careful and mark it
- breaking.
-
- Note that `git-features` and `git-pack` are still on edition 2018
- as they make use of a workaround to support (safe) mutable access
- to non-overlapping entries in a slice which doesn't work anymore
- in edition 2021.
+ - <csr-id-f7f136dbe4f86e7dee1d54835c420ec07c96cd78/> uniformize deny attributes
+ - <csr-id-533e887e80c5f7ede8392884562e1c5ba56fb9a8/> remove default link to cargo doc everywhere
-### Changed (BREAKING)
+### Documentation
- - <csr-id-d7ee622cfa9fc3cf7a97b823dd70f0aa1355365e/> Simplify `Cache` by removing its lifetime.
- The lifetime was more of a premature optimization that makes actually using
- the cache much harder than it needs to be.
- - <csr-id-99905bacace8aed42b16d43f0f04cae996cb971c/> upgrade `bstr` to `1.0.1`
+ - <csr-id-39ed9eda62b7718d5109135e5ad406fb1fe2978c/> fix typos
### New Features
- <csr-id-b1c40b0364ef092cd52d03b34f491b254816b18d/> use docsrs feature in code to show what is feature-gated automatically on docs.rs
- <csr-id-517677147f1c17304c62cf97a1dd09f232ebf5db/> pass --cfg docsrs when compiling for https://docs.rs
-### Chore
+### Changed (BREAKING)
- - <csr-id-f7f136dbe4f86e7dee1d54835c420ec07c96cd78/> uniformize deny attributes
- - <csr-id-533e887e80c5f7ede8392884562e1c5ba56fb9a8/> remove default link to cargo doc everywhere
+ - <csr-id-d7ee622cfa9fc3cf7a97b823dd70f0aa1355365e/> Simplify `Cache` by removing its lifetime.
+ The lifetime was more of a premature optimization that makes actually using
+ the cache much harder than it needs to be.
+ - <csr-id-99905bacace8aed42b16d43f0f04cae996cb971c/> upgrade `bstr` to `1.0.1`
-### Documentation
+### New Features (BREAKING)
- - <csr-id-39ed9eda62b7718d5109135e5ad406fb1fe2978c/> fix typos
+ - <csr-id-3d8fa8fef9800b1576beab8a5bc39b821157a5ed/> upgrade edition to 2021 in most crates.
+ MSRV for this is 1.56, and we are now at 1.60 so should be compatible.
+ This isn't more than a patch release as it should break nobody
+ who is adhering to the MSRV, but let's be careful and mark it
+ breaking.
+
+ Note that `git-features` and `git-pack` are still on edition 2018
+ as they make use of a workaround to support (safe) mutable access
+ to non-overlapping entries in a slice which doesn't work anymore
+ in edition 2021.
### Commit Statistics
@@ -761,99 +1098,3 @@ A maintenance release without user-facing changes.
- Release git-worktree v0.0.0 ([`ddb1bf4`](https://github.com/Byron/gitoxide/commit/ddb1bf49e3b5b663fcf166d8cbce416e78d9fc18))
</details>
-## 0.12.1 (2023-01-10)
-
-A maintenance release without user-facing changes.
-
-## 0.12.0 (2023-01-09)
-
-A maintenance release without user-facing changes.
-
-## 0.11.0 (2022-12-30)
-
-### Changed (BREAKING)
-
- - <csr-id-d7ee622cfa9fc3cf7a97b823dd70f0aa1355365e/> Simplify `Cache` by removing its lifetime.
- The lifetime was more of a premature optimization that makes actually using
- the cache much harder than it needs to be.
-
-## 0.10.0 (2022-12-19)
-
-A maintenance release without user-facing changes.
-
-## 0.9.0 (2022-11-21)
-
-### New Features (BREAKING)
-
- - <csr-id-3d8fa8fef9800b1576beab8a5bc39b821157a5ed/> upgrade edition to 2021 in most crates.
- MSRV for this is 1.56, and we are now at 1.60 so should be compatible.
- This isn't more than a patch release as it should break nobody
- who is adhering to the MSRV, but let's be careful and mark it
- breaking.
-
- Note that `gix-features` and `gix-pack` are still on edition 2018
- as they make use of a workaround to support (safe) mutable access
- to non-overlapping entries in a slice which doesn't work anymore
- in edition 2021.
-
-## 0.8.0 (2022-11-17)
-
-A maintenance release without user-facing changes.
-
-## 0.7.0 (2022-11-06)
-
-A maintenance release without user-facing changes.
-
-## 0.6.0 (2022-10-10)
-
-Maintenance release without user-facing changes.
-
-## 0.5.0 (2022-09-20)
-
-### Changed (BREAKING)
-
- - <csr-id-99905bacace8aed42b16d43f0f04cae996cb971c/> upgrade `bstr` to `1.0.1`
-
-## 0.4.3 (2022-08-27)
-
-Maintenance release without user-facing changes.
-
-## 0.4.2 (2022-08-24)
-
-<csr-id-f7f136dbe4f86e7dee1d54835c420ec07c96cd78/>
-<csr-id-533e887e80c5f7ede8392884562e1c5ba56fb9a8/>
-
-### Chore
-
- - <csr-id-f7f136dbe4f86e7dee1d54835c420ec07c96cd78/> uniformize deny attributes
- - <csr-id-533e887e80c5f7ede8392884562e1c5ba56fb9a8/> remove default link to cargo doc everywhere
-
-### New Features
-
- - <csr-id-b1c40b0364ef092cd52d03b34f491b254816b18d/> use docsrs feature in code to show what is feature-gated automatically on docs.rs
- - <csr-id-517677147f1c17304c62cf97a1dd09f232ebf5db/> pass --cfg docsrs when compiling for https://docs.rs
-
-## 0.4.1 (2022-08-17)
-
-A maintenance release without user facing changes.
-
-## 0.4.0 (2022-07-22)
-
-This is a maintenance release with no functional changes.
-
-## 0.3.0 (2022-06-13)
-
-A maintenance release without user-facing changes.
-
-## 0.2.0 (2022-05-18)
-
-A maintenance release without documented changes.
-
-## 0.1.0 (2022-04-03)
-
-An initial release with the ability to checkout indices with simple files only.
-
-## 0.0.0 (2022-01-08)
-
-Reserve the name for a necessary crate of the `gitoxide` project.
-
diff --git a/vendor/gix-worktree/Cargo.toml b/vendor/gix-worktree/Cargo.toml
index a6a8c4769..5b8133ecf 100644
--- a/vendor/gix-worktree/Cargo.toml
+++ b/vendor/gix-worktree/Cargo.toml
@@ -11,17 +11,18 @@
[package]
edition = "2021"
-rust-version = "1.64"
+rust-version = "1.65"
name = "gix-worktree"
-version = "0.18.0"
+version = "0.26.0"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
include = [
"src/**/*",
"LICENSE-*",
"CHANGELOG.md",
]
-description = "A WIP crate of the gitoxide project dedicated implementing everything around working trees and git excludes"
-license = "MIT/Apache-2.0"
+autotests = false
+description = "A crate of the gitoxide project for shared worktree related types and utilities."
+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/worktree-multi-threaded.rs"
-required-features = ["internal-testing-gix-features-parallel"]
-
-[[test]]
-name = "single-threaded"
-path = "tests/worktree-single-threaded.rs"
-required-features = ["internal-testing-to-avoid-being-run-by-cargo-test-all"]
-
[dependencies.bstr]
version = "1.3.0"
default-features = false
@@ -55,38 +46,33 @@ default-features = false
version = "0.2.0"
optional = true
-[dependencies.filetime]
-version = "0.2.15"
-
[dependencies.gix-attributes]
-version = "^0.13.0"
+version = "^0.19.0"
+optional = true
[dependencies.gix-features]
-version = "^0.30.0"
+version = "^0.35.0"
[dependencies.gix-fs]
-version = "^0.2.0"
+version = "^0.7.0"
[dependencies.gix-glob]
-version = "^0.8.0"
+version = "^0.13.0"
[dependencies.gix-hash]
-version = "^0.11.2"
+version = "^0.13.0"
[dependencies.gix-ignore]
-version = "^0.3.0"
+version = "^0.8.0"
[dependencies.gix-index]
-version = "^0.17.0"
+version = "^0.25.0"
[dependencies.gix-object]
-version = "^0.30.0"
+version = "^0.37.0"
[dependencies.gix-path]
-version = "^0.8.1"
-
-[dependencies.io-close]
-version = "0.3.7"
+version = "^0.10.0"
[dependencies.serde]
version = "1.0.114"
@@ -94,27 +80,15 @@ features = ["derive"]
optional = true
default-features = false
-[dependencies.thiserror]
-version = "1.0.26"
-
-[dev-dependencies.symlink]
-version = "0.1.0"
-
-[dev-dependencies.tempfile]
-version = "3.2.0"
-
-[dev-dependencies.walkdir]
-version = "2.3.2"
-
[features]
-internal-testing-gix-features-parallel = ["gix-features/parallel"]
-internal-testing-to-avoid-being-run-by-cargo-test-all = []
+attributes = ["dep:gix-attributes"]
+default = ["attributes"]
serde = [
"dep:serde",
"bstr/serde",
"gix-index/serde",
"gix-hash/serde",
"gix-object/serde",
- "gix-attributes/serde",
+ "gix-attributes?/serde",
"gix-ignore/serde",
]
diff --git a/vendor/gix-worktree/src/checkout/chunk.rs b/vendor/gix-worktree/src/checkout/chunk.rs
deleted file mode 100644
index 9de9e424e..000000000
--- a/vendor/gix-worktree/src/checkout/chunk.rs
+++ /dev/null
@@ -1,182 +0,0 @@
-use std::sync::atomic::{AtomicUsize, Ordering};
-
-use bstr::BStr;
-use gix_features::progress::Progress;
-use gix_hash::oid;
-
-use crate::{checkout, checkout::entry, Cache};
-
-mod reduce {
- use std::{
- marker::PhantomData,
- sync::atomic::{AtomicUsize, Ordering},
- };
-
- use gix_features::progress::Progress;
-
- use crate::checkout;
-
- pub struct Reduce<'a, 'entry, P1, P2, E> {
- pub files: &'a mut P1,
- pub bytes: &'a mut P2,
- pub num_files: &'a AtomicUsize,
- pub aggregate: super::Outcome<'entry>,
- pub marker: PhantomData<E>,
- }
-
- impl<'a, 'entry, P1, P2, E> gix_features::parallel::Reduce for Reduce<'a, 'entry, P1, P2, E>
- where
- P1: Progress,
- P2: Progress,
- E: std::error::Error + Send + Sync + 'static,
- {
- type Input = Result<super::Outcome<'entry>, checkout::Error<E>>;
- type FeedProduce = ();
- type Output = super::Outcome<'entry>;
- type Error = checkout::Error<E>;
-
- fn feed(&mut self, item: Self::Input) -> Result<Self::FeedProduce, Self::Error> {
- let item = item?;
- let super::Outcome {
- bytes_written,
- delayed,
- errors,
- collisions,
- } = item;
- self.aggregate.bytes_written += bytes_written;
- self.aggregate.delayed.extend(delayed);
- self.aggregate.errors.extend(errors);
- self.aggregate.collisions.extend(collisions);
-
- self.bytes.set(self.aggregate.bytes_written as usize);
- self.files.set(self.num_files.load(Ordering::Relaxed));
-
- Ok(())
- }
-
- fn finalize(self) -> Result<Self::Output, Self::Error> {
- Ok(self.aggregate)
- }
- }
-}
-pub use reduce::Reduce;
-
-#[derive(Default)]
-pub struct Outcome<'a> {
- pub collisions: Vec<checkout::Collision>,
- pub errors: Vec<checkout::ErrorRecord>,
- pub delayed: Vec<(&'a mut gix_index::Entry, &'a BStr)>,
- pub bytes_written: u64,
-}
-
-#[derive(Clone)]
-pub struct Context<'a, Find: Clone> {
- pub find: Find,
- pub path_cache: Cache,
- pub buf: Vec<u8>,
- pub options: checkout::Options,
- /// We keep these shared so that there is the chance for printing numbers that aren't looking like
- /// multiple of chunk sizes. Purely cosmetic. Otherwise it's the same as `files`.
- pub num_files: &'a AtomicUsize,
-}
-
-pub fn process<'entry, Find, E>(
- entries_with_paths: impl Iterator<Item = (&'entry mut gix_index::Entry, &'entry BStr)>,
- files: &mut impl Progress,
- bytes: &mut impl Progress,
- ctx: &mut Context<'_, Find>,
-) -> Result<Outcome<'entry>, checkout::Error<E>>
-where
- Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Clone,
- E: std::error::Error + Send + Sync + 'static,
-{
- let mut delayed = Vec::new();
- let mut collisions = Vec::new();
- let mut errors = Vec::new();
- let mut bytes_written = 0;
-
- for (entry, entry_path) in entries_with_paths {
- // TODO: write test for that
- if entry.flags.contains(gix_index::entry::Flags::SKIP_WORKTREE) {
- files.inc();
- continue;
- }
-
- // Symlinks always have to be delayed on windows as they have to point to something that exists on creation.
- // And even if not, there is a distinction between file and directory symlinks, hence we have to check what the target is
- // before creating it.
- // And to keep things sane, we just do the same on non-windows as well which is similar to what git does and adds some safety
- // around writing through symlinks (even though we handle this).
- // This also means that we prefer content in files over symlinks in case of collisions, which probably is for the better, too.
- if entry.mode == gix_index::entry::Mode::SYMLINK {
- delayed.push((entry, entry_path));
- continue;
- }
-
- bytes_written +=
- checkout_entry_handle_result(entry, entry_path, &mut errors, &mut collisions, files, bytes, ctx)? as u64;
- }
-
- Ok(Outcome {
- bytes_written,
- errors,
- collisions,
- delayed,
- })
-}
-
-pub fn checkout_entry_handle_result<Find, E>(
- entry: &mut gix_index::Entry,
- entry_path: &BStr,
- errors: &mut Vec<checkout::ErrorRecord>,
- collisions: &mut Vec<checkout::Collision>,
- files: &mut impl Progress,
- bytes: &mut impl Progress,
- Context {
- find,
- path_cache,
- buf,
- options,
- num_files,
- }: &mut Context<'_, Find>,
-) -> Result<usize, checkout::Error<E>>
-where
- Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Clone,
- E: std::error::Error + Send + Sync + 'static,
-{
- let res = entry::checkout(
- entry,
- entry_path,
- entry::Context { find, path_cache, buf },
- options.clone(),
- );
- files.inc();
- num_files.fetch_add(1, Ordering::SeqCst);
- match res {
- Ok(object_size) => {
- bytes.inc_by(object_size);
- Ok(object_size)
- }
- Err(checkout::Error::Io(err)) if gix_fs::symlink::is_collision_error(&err) => {
- // We are here because a file existed or was blocked by a directory which shouldn't be possible unless
- // we are on a file insensitive file system.
- files.fail(format!("{}: collided ({:?})", entry_path, err.kind()));
- collisions.push(checkout::Collision {
- path: entry_path.into(),
- error_kind: err.kind(),
- });
- Ok(0)
- }
- Err(err) => {
- if options.keep_going {
- errors.push(checkout::ErrorRecord {
- path: entry_path.into(),
- error: Box::new(err),
- });
- Ok(0)
- } else {
- Err(err)
- }
- }
- }
-}
diff --git a/vendor/gix-worktree/src/checkout/entry.rs b/vendor/gix-worktree/src/checkout/entry.rs
deleted file mode 100644
index 524cf90f2..000000000
--- a/vendor/gix-worktree/src/checkout/entry.rs
+++ /dev/null
@@ -1,166 +0,0 @@
-use std::{fs::OpenOptions, io::Write, path::Path};
-
-use bstr::BStr;
-use gix_hash::oid;
-use gix_index::{entry::Stat, Entry};
-use io_close::Close;
-
-use crate::Cache;
-
-pub struct Context<'a, Find> {
- pub find: &'a mut Find,
- pub path_cache: &'a mut Cache,
- pub buf: &'a mut Vec<u8>,
-}
-
-#[cfg_attr(not(unix), allow(unused_variables))]
-pub fn checkout<Find, E>(
- entry: &mut Entry,
- entry_path: &BStr,
- Context { find, path_cache, buf }: Context<'_, Find>,
- crate::checkout::Options {
- fs: gix_fs::Capabilities {
- symlink,
- executable_bit,
- ..
- },
- destination_is_initially_empty,
- overwrite_existing,
- ..
- }: crate::checkout::Options,
-) -> Result<usize, crate::checkout::Error<E>>
-where
- Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E>,
- E: std::error::Error + Send + Sync + 'static,
-{
- let dest_relative = gix_path::try_from_bstr(entry_path).map_err(|_| crate::checkout::Error::IllformedUtf8 {
- path: entry_path.to_owned(),
- })?;
- let is_dir = Some(entry.mode == gix_index::entry::Mode::COMMIT || entry.mode == gix_index::entry::Mode::DIR);
- let dest = path_cache.at_path(dest_relative, is_dir, &mut *find)?.path();
-
- let object_size = match entry.mode {
- gix_index::entry::Mode::FILE | gix_index::entry::Mode::FILE_EXECUTABLE => {
- let obj = find(&entry.id, buf).map_err(|err| crate::checkout::Error::Find {
- err,
- oid: entry.id,
- path: dest.to_path_buf(),
- })?;
-
- #[cfg_attr(not(unix), allow(unused_mut))]
- let mut options = open_options(dest, destination_is_initially_empty, overwrite_existing);
- let needs_executable_bit = executable_bit && entry.mode == gix_index::entry::Mode::FILE_EXECUTABLE;
- #[cfg(unix)]
- if needs_executable_bit && destination_is_initially_empty {
- use std::os::unix::fs::OpenOptionsExt;
- // Note that these only work if the file was newly created, but won't if it's already
- // existing, possibly without the executable bit set. Thus we do this only if the file is new.
- options.mode(0o777);
- }
-
- let mut file = try_write_or_unlink(dest, overwrite_existing, |p| options.open(p))?;
- file.write_all(obj.data)?;
-
- // For possibly existing, overwritten files, we must change the file mode explicitly.
- #[cfg(unix)]
- if needs_executable_bit && !destination_is_initially_empty {
- use std::os::unix::fs::PermissionsExt;
- let mut perm = std::fs::symlink_metadata(dest)?.permissions();
- perm.set_mode(0o777);
- std::fs::set_permissions(dest, perm)?;
- }
- // NOTE: we don't call `file.sync_all()` here knowing that some filesystems don't handle this well.
- // revisit this once there is a bug to fix.
- entry.stat = Stat::from_fs(&file.metadata()?)?;
- file.close()?;
- obj.data.len()
- }
- gix_index::entry::Mode::SYMLINK => {
- let obj = find(&entry.id, buf).map_err(|err| crate::checkout::Error::Find {
- err,
- oid: entry.id,
- path: dest.to_path_buf(),
- })?;
- let symlink_destination = gix_path::try_from_byte_slice(obj.data)
- .map_err(|_| crate::checkout::Error::IllformedUtf8 { path: obj.data.into() })?;
-
- if symlink {
- try_write_or_unlink(dest, overwrite_existing, |p| {
- gix_fs::symlink::create(symlink_destination, p)
- })?;
- } else {
- let mut file = try_write_or_unlink(dest, overwrite_existing, |p| {
- open_options(p, destination_is_initially_empty, overwrite_existing).open(dest)
- })?;
- file.write_all(obj.data)?;
- file.close()?;
- }
-
- entry.stat = Stat::from_fs(&std::fs::symlink_metadata(dest)?)?;
- obj.data.len()
- }
- gix_index::entry::Mode::DIR => todo!(),
- gix_index::entry::Mode::COMMIT => todo!(),
- _ => unreachable!(),
- };
- Ok(object_size)
-}
-
-/// Note that this works only because we assume to not race ourselves when symlinks are involved, and we do this by
-/// delaying symlink creation to the end and will always do that sequentially.
-/// It's still possible to fall for a race if other actors create symlinks in our path, but that's nothing to defend against.
-fn try_write_or_unlink<T>(
- path: &Path,
- overwrite_existing: bool,
- op: impl Fn(&Path) -> std::io::Result<T>,
-) -> std::io::Result<T> {
- if overwrite_existing {
- match op(path) {
- Ok(res) => Ok(res),
- Err(err) if gix_fs::symlink::is_collision_error(&err) => {
- try_unlink_path_recursively(path, &std::fs::symlink_metadata(path)?)?;
- op(path)
- }
- Err(err) => Err(err),
- }
- } else {
- op(path)
- }
-}
-
-fn try_unlink_path_recursively(path: &Path, path_meta: &std::fs::Metadata) -> std::io::Result<()> {
- if path_meta.is_dir() {
- std::fs::remove_dir_all(path)
- } else if path_meta.file_type().is_symlink() {
- gix_fs::symlink::remove(path)
- } else {
- std::fs::remove_file(path)
- }
-}
-
-#[cfg(not(debug_assertions))]
-fn debug_assert_dest_is_no_symlink(_path: &Path) {}
-
-/// This is a debug assertion as we expect the machinery calling this to prevent this possibility in the first place
-#[cfg(debug_assertions)]
-fn debug_assert_dest_is_no_symlink(path: &Path) {
- if let Ok(meta) = path.metadata() {
- debug_assert!(
- !meta.file_type().is_symlink(),
- "BUG: should not ever allow to overwrite/write-into the target of a symbolic link: {}",
- path.display()
- );
- }
-}
-
-fn open_options(path: &Path, destination_is_initially_empty: bool, overwrite_existing: bool) -> OpenOptions {
- if overwrite_existing || !destination_is_initially_empty {
- debug_assert_dest_is_no_symlink(path);
- }
- let mut options = gix_features::fs::open_options_no_follow();
- options
- .create_new(destination_is_initially_empty && !overwrite_existing)
- .create(!destination_is_initially_empty || overwrite_existing)
- .write(true);
- options
-}
diff --git a/vendor/gix-worktree/src/checkout/function.rs b/vendor/gix-worktree/src/checkout/function.rs
deleted file mode 100644
index 8e69fd4d6..000000000
--- a/vendor/gix-worktree/src/checkout/function.rs
+++ /dev/null
@@ -1,119 +0,0 @@
-use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
-
-use gix_features::{interrupt, parallel::in_parallel, progress, progress::Progress};
-use gix_hash::oid;
-
-use crate::{cache, checkout::chunk, Cache};
-
-/// Note that interruption still produce an `Ok(…)` value, so the caller should look at `should_interrupt` to communicate the outcome.
-/// `dir` is the directory into which to checkout the `index`.
-/// `git_dir` is the `.git` directory for reading additional per-repository configuration files.
-#[allow(clippy::too_many_arguments)]
-pub fn checkout<Find, E>(
- index: &mut gix_index::State,
- dir: impl Into<std::path::PathBuf>,
- find: Find,
- files: &mut impl Progress,
- bytes: &mut impl Progress,
- should_interrupt: &AtomicBool,
- options: crate::checkout::Options,
-) -> Result<crate::checkout::Outcome, crate::checkout::Error<E>>
-where
- Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Send + Clone,
- E: std::error::Error + Send + Sync + 'static,
-{
- let paths = index.take_path_backing();
- let res = checkout_inner(index, &paths, dir, find, files, bytes, should_interrupt, options);
- index.return_path_backing(paths);
- res
-}
-
-#[allow(clippy::too_many_arguments)]
-fn checkout_inner<Find, E>(
- index: &mut gix_index::State,
- paths: &gix_index::PathStorage,
- dir: impl Into<std::path::PathBuf>,
- find: Find,
- files: &mut impl Progress,
- bytes: &mut impl Progress,
- should_interrupt: &AtomicBool,
- options: crate::checkout::Options,
-) -> Result<crate::checkout::Outcome, crate::checkout::Error<E>>
-where
- Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Send + Clone,
- E: std::error::Error + Send + Sync + 'static,
-{
- let num_files = AtomicUsize::default();
- let dir = dir.into();
- let case = if options.fs.ignore_case {
- gix_glob::pattern::Case::Fold
- } else {
- gix_glob::pattern::Case::Sensitive
- };
- let (chunk_size, thread_limit, num_threads) = gix_features::parallel::optimize_chunk_size_and_thread_limit(
- 100,
- index.entries().len().into(),
- options.thread_limit,
- None,
- );
-
- let state = cache::State::for_checkout(options.overwrite_existing, options.attributes.clone());
- let attribute_files = state.id_mappings_from_index(index, paths, Default::default(), case);
- let mut ctx = chunk::Context {
- buf: Vec::new(),
- path_cache: Cache::new(dir, state, case, Vec::with_capacity(512), attribute_files),
- find,
- options,
- num_files: &num_files,
- };
-
- let chunk::Outcome {
- mut collisions,
- mut errors,
- mut bytes_written,
- delayed,
- } = if num_threads == 1 {
- let entries_with_paths = interrupt::Iter::new(index.entries_mut_with_paths_in(paths), should_interrupt);
- chunk::process(entries_with_paths, files, bytes, &mut ctx)?
- } else {
- let entries_with_paths = interrupt::Iter::new(index.entries_mut_with_paths_in(paths), should_interrupt);
- in_parallel(
- gix_features::iter::Chunks {
- inner: entries_with_paths,
- size: chunk_size,
- },
- thread_limit,
- {
- let ctx = ctx.clone();
- move |_| (progress::Discard, progress::Discard, ctx.clone())
- },
- |chunk, (files, bytes, ctx)| chunk::process(chunk.into_iter(), files, bytes, ctx),
- chunk::Reduce {
- files,
- bytes,
- num_files: &num_files,
- aggregate: Default::default(),
- marker: Default::default(),
- },
- )?
- };
-
- for (entry, entry_path) in delayed {
- bytes_written += chunk::checkout_entry_handle_result(
- entry,
- entry_path,
- &mut errors,
- &mut collisions,
- files,
- bytes,
- &mut ctx,
- )? as u64;
- }
-
- Ok(crate::checkout::Outcome {
- files_updated: num_files.load(Ordering::Relaxed),
- collisions,
- errors,
- bytes_written,
- })
-}
diff --git a/vendor/gix-worktree/src/checkout/mod.rs b/vendor/gix-worktree/src/checkout/mod.rs
deleted file mode 100644
index 11f39b1b2..000000000
--- a/vendor/gix-worktree/src/checkout/mod.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-#![allow(missing_docs)]
-
-use bstr::BString;
-use gix_index::entry::stat;
-
-#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct Collision {
- /// the path that collided with something already present on disk.
- pub path: BString,
- /// The io error we encountered when checking out `path`.
- pub error_kind: std::io::ErrorKind,
-}
-
-pub struct ErrorRecord {
- /// the path that encountered the error.
- pub path: BString,
- /// The error
- pub error: Box<dyn std::error::Error + Send + Sync + 'static>,
-}
-
-#[derive(Default)]
-pub struct Outcome {
- /// The amount of files updated, or created.
- pub files_updated: usize,
- /// The amount of bytes written to disk,
- pub bytes_written: u64,
- pub collisions: Vec<Collision>,
- pub errors: Vec<ErrorRecord>,
-}
-
-#[derive(Clone, Default)]
-pub struct Options {
- /// capabilities of the file system
- pub fs: gix_fs::Capabilities,
- /// If set, don't use more than this amount of threads.
- /// Otherwise, usually use as many threads as there are logical cores.
- /// A value of 0 is interpreted as no-limit
- pub thread_limit: Option<usize>,
- /// If true, we assume no file to exist in the target directory, and want exclusive access to it.
- /// This should be enabled when cloning to avoid checks for freshness of files. This also enables
- /// detection of collisions based on whether or not exclusive file creation succeeds or fails.
- pub destination_is_initially_empty: bool,
- /// If true, default false, worktree entries on disk will be overwritten with content from the index
- /// even if they appear to be changed. When creating directories that clash with existing worktree entries,
- /// these will try to delete the existing entry.
- /// This is similar in behaviour as `git checkout --force`.
- pub overwrite_existing: bool,
- /// If true, default false, try to checkout as much as possible and don't abort on first error which isn't
- /// due to a conflict.
- /// The checkout operation will never fail, but count the encountered errors instead along with their paths.
- pub keep_going: bool,
- /// Control how stat comparisons are made when checking if a file is fresh.
- pub stat_options: stat::Options,
- /// A stack of attributes to use with the filesystem cache to use as driver for filters.
- pub attributes: crate::cache::state::Attributes,
-}
-
-#[derive(Debug, thiserror::Error)]
-pub enum Error<E: std::error::Error + Send + Sync + 'static> {
- #[error("Could not convert path to UTF8: {}", .path)]
- IllformedUtf8 { path: BString },
- #[error("The clock was off when reading file related metadata after updating a file on disk")]
- Time(#[from] std::time::SystemTimeError),
- #[error("IO error while writing blob or reading file metadata or changing filetype")]
- Io(#[from] std::io::Error),
- #[error("object {} for checkout at {} could not be retrieved from object database", .oid.to_hex(), .path.display())]
- Find {
- #[source]
- err: E,
- oid: gix_hash::ObjectId,
- path: std::path::PathBuf,
- },
-}
-
-mod chunk;
-mod entry;
-pub(crate) mod function;
diff --git a/vendor/gix-worktree/src/lib.rs b/vendor/gix-worktree/src/lib.rs
index 2626fe508..32d1d7c0e 100644
--- a/vendor/gix-worktree/src/lib.rs
+++ b/vendor/gix-worktree/src/lib.rs
@@ -1,4 +1,4 @@
-//! A crate with all index-centric functionality that is interacting with a worktree.
+//! A crate with utility types for use by other crates that implement specifics.
//!
//! Unless specified differently, all operations need an index file (e.g. `.git/index`) as driver.
//!
@@ -11,9 +11,6 @@
#![deny(missing_docs, rust_2018_idioms, unsafe_code)]
use bstr::BString;
-///
-pub mod read;
-
/// A cache for efficiently executing operations on directories and files which are encountered in sorted order.
/// That way, these operations can be re-used for subsequent invocations in the same directory.
///
@@ -35,25 +32,20 @@ pub mod read;
///
/// The caching is only useful if consecutive calls to create a directory are using a sorted list of entries.
#[derive(Clone)]
-pub struct Cache {
+pub struct Stack {
stack: gix_fs::Stack,
/// tells us what to do as we change paths.
- state: cache::State,
+ state: stack::State,
/// A buffer used when reading attribute or ignore files or their respective objects from the object database.
buf: Vec<u8>,
/// If case folding should happen when looking up attributes or exclusions.
case: gix_glob::pattern::Case,
/// A lookup table for object ids to read from in some situations when looking up attributes or exclusions.
id_mappings: Vec<PathIdMapping>,
- statistics: cache::Statistics,
+ statistics: stack::Statistics,
}
pub(crate) type PathIdMapping = (BString, gix_hash::ObjectId);
///
-pub mod cache;
-pub mod checkout;
-pub use checkout::function::checkout;
-
-pub mod status;
-pub use status::function::status;
+pub mod stack;
diff --git a/vendor/gix-worktree/src/read.rs b/vendor/gix-worktree/src/read.rs
deleted file mode 100644
index a54fc2c76..000000000
--- a/vendor/gix-worktree/src/read.rs
+++ /dev/null
@@ -1,64 +0,0 @@
-//! This module allows creating git blobs from worktree files.
-//!
-//! For the most part a blob just contains the raw on-disk data. However symlinks need to be considered properly
-//! and attributes/config options need to be considered.
-
-use std::{
- fs::{read_link, File},
- io::{self, Read},
- path::Path,
-};
-
-use gix_object::Blob;
-use gix_path as path;
-
-// TODO: tests
-
-// TODO: what to do about precompose unicode and ignore_case for symlinks
-
-/// Create a blob from a file or symlink.
-pub fn blob(path: &Path, capabilities: &gix_fs::Capabilities) -> io::Result<Blob> {
- let mut data = Vec::new();
- data_to_buf(path, &mut data, capabilities)?;
- Ok(Blob { data })
-}
-
-/// Create a blob from a file or symlink.
-pub fn blob_with_meta(path: &Path, is_symlink: bool, capabilities: &gix_fs::Capabilities) -> io::Result<Blob> {
- let mut data = Vec::new();
- data_to_buf_with_meta(path, &mut data, is_symlink, capabilities)?;
- Ok(Blob { data })
-}
-
-/// Create blob data from a file or symlink.
-pub fn data_to_buf<'a>(path: &Path, buf: &'a mut Vec<u8>, capabilities: &gix_fs::Capabilities) -> io::Result<&'a [u8]> {
- data_to_buf_with_meta(path, buf, path.symlink_metadata()?.is_symlink(), capabilities)
-}
-
-/// Create a blob from a file or symlink.
-pub fn data_to_buf_with_meta<'a>(
- path: &Path,
- buf: &'a mut Vec<u8>,
- is_symlink: bool,
- capabilities: &gix_fs::Capabilities,
-) -> io::Result<&'a [u8]> {
- buf.clear();
- // symlinks are only stored as actual symlinks if the FS supports it otherwise they are just
- // normal files with their content equal to the linked path (so can be read normally)
- //
- if is_symlink && capabilities.symlink {
- // conversion to bstr can never fail because symlinks are only used
- // on unix (by git) so no reason to use the try version here
- let symlink_path = path::into_bstr(read_link(path)?);
- buf.extend_from_slice(&symlink_path);
- // TODO: there is no reason this should be a clone
- // std isn't great about allowing users to avoid allocations but we could
- // simply write our own wrapper around libc::readlink which reuses the
- // buffer. This would require unsafe code tough (obviously)
- } else {
- buf.clear();
- File::open(path)?.read_to_end(buf)?;
- // TODO apply filters
- }
- Ok(buf.as_slice())
-}
diff --git a/vendor/gix-worktree/src/cache/delegate.rs b/vendor/gix-worktree/src/stack/delegate.rs
index 64b5a9bab..28d8ecf34 100644
--- a/vendor/gix-worktree/src/cache/delegate.rs
+++ b/vendor/gix-worktree/src/stack/delegate.rs
@@ -1,4 +1,6 @@
-use crate::{cache::State, PathIdMapping};
+use bstr::{BStr, ByteSlice};
+
+use crate::{stack::State, PathIdMapping};
/// Various aggregate numbers related to the stack delegate itself.
#[derive(Default, Clone, Copy, Debug)]
@@ -16,36 +18,44 @@ pub struct Statistics {
pub pop_directory: usize,
}
-pub(crate) struct StackDelegate<'a, Find> {
+pub(crate) type FindFn<'a> = dyn for<'b> FnMut(
+ &gix_hash::oid,
+ &'b mut Vec<u8>,
+ ) -> Result<gix_object::BlobRef<'b>, Box<dyn std::error::Error + Send + Sync>>
+ + 'a;
+
+pub(crate) struct StackDelegate<'a, 'find> {
pub state: &'a mut State,
pub buf: &'a mut Vec<u8>,
+ #[cfg_attr(not(feature = "attributes"), allow(dead_code))]
pub is_dir: bool,
pub id_mappings: &'a Vec<PathIdMapping>,
- pub find: Find,
+ pub find: &'find mut FindFn<'find>,
pub case: gix_glob::pattern::Case,
pub statistics: &'a mut super::Statistics,
}
-impl<'a, Find, E> gix_fs::stack::Delegate for StackDelegate<'a, Find>
-where
- Find: for<'b> FnMut(&gix_hash::oid, &'b mut Vec<u8>) -> Result<gix_object::BlobRef<'b>, E>,
- E: std::error::Error + Send + Sync + 'static,
-{
+impl<'a, 'find> gix_fs::stack::Delegate for StackDelegate<'a, 'find> {
fn push_directory(&mut self, stack: &gix_fs::Stack) -> std::io::Result<()> {
self.statistics.delegate.push_directory += 1;
let dir_bstr = gix_path::into_bstr(stack.current());
- let mut rela_dir = gix_glob::search::pattern::strip_base_handle_recompute_basename_pos(
- gix_path::into_bstr(stack.root()).as_ref(),
- dir_bstr.as_ref(),
- None,
- self.case,
- )
- .expect("dir in root")
- .0;
- if rela_dir.starts_with(b"/") {
- rela_dir = &rela_dir[1..];
- }
+ let rela_dir_cow = gix_path::to_unix_separators_on_windows(
+ gix_glob::search::pattern::strip_base_handle_recompute_basename_pos(
+ gix_path::into_bstr(stack.root()).as_ref(),
+ dir_bstr.as_ref(),
+ None,
+ self.case,
+ )
+ .expect("dir in root")
+ .0,
+ );
+ let rela_dir: &BStr = if rela_dir_cow.starts_with(b"/") {
+ rela_dir_cow[1..].as_bstr()
+ } else {
+ rela_dir_cow.as_ref()
+ };
match &mut self.state {
+ #[cfg(feature = "attributes")]
State::CreateDirectoryAndAttributesStack { attributes, .. } => {
attributes.push_directory(
stack.root(),
@@ -53,10 +63,11 @@ where
rela_dir,
self.buf,
self.id_mappings,
- &mut self.find,
+ self.find,
&mut self.statistics.attributes,
)?;
}
+ #[cfg(feature = "attributes")]
State::AttributesAndIgnoreStack { ignore, attributes } => {
attributes.push_directory(
stack.root(),
@@ -78,6 +89,16 @@ where
&mut self.statistics.ignore,
)?
}
+ #[cfg(feature = "attributes")]
+ State::AttributesStack(attributes) => attributes.push_directory(
+ stack.root(),
+ stack.current(),
+ rela_dir,
+ self.buf,
+ self.id_mappings,
+ &mut self.find,
+ &mut self.statistics.attributes,
+ )?,
State::IgnoreStack(ignore) => ignore.push_directory(
stack.root(),
stack.current(),
@@ -92,9 +113,11 @@ where
Ok(())
}
+ #[cfg_attr(not(feature = "attributes"), allow(unused_variables))]
fn push(&mut self, is_last_component: bool, stack: &gix_fs::Stack) -> std::io::Result<()> {
self.statistics.delegate.push_element += 1;
match &mut self.state {
+ #[cfg(feature = "attributes")]
State::CreateDirectoryAndAttributesStack {
unlink_on_collision,
attributes: _,
@@ -105,7 +128,9 @@ where
&mut self.statistics.delegate.num_mkdir_calls,
*unlink_on_collision,
)?,
- State::AttributesAndIgnoreStack { .. } | State::IgnoreStack(_) => {}
+ #[cfg(feature = "attributes")]
+ State::AttributesAndIgnoreStack { .. } | State::AttributesStack(_) => {}
+ State::IgnoreStack(_) => {}
}
Ok(())
}
@@ -113,13 +138,19 @@ where
fn pop_directory(&mut self) {
self.statistics.delegate.pop_directory += 1;
match &mut self.state {
+ #[cfg(feature = "attributes")]
State::CreateDirectoryAndAttributesStack { attributes, .. } => {
attributes.pop_directory();
}
+ #[cfg(feature = "attributes")]
State::AttributesAndIgnoreStack { attributes, ignore } => {
attributes.pop_directory();
ignore.pop_directory();
}
+ #[cfg(feature = "attributes")]
+ State::AttributesStack(attributes) => {
+ attributes.pop_directory();
+ }
State::IgnoreStack(ignore) => {
ignore.pop_directory();
}
@@ -127,6 +158,7 @@ where
}
}
+#[cfg(feature = "attributes")]
fn create_leading_directory(
is_last_component: bool,
stack: &gix_fs::Stack,
diff --git a/vendor/gix-worktree/src/cache/mod.rs b/vendor/gix-worktree/src/stack/mod.rs
index b3ccc6bac..c10320199 100644
--- a/vendor/gix-worktree/src/cache/mod.rs
+++ b/vendor/gix-worktree/src/stack/mod.rs
@@ -4,10 +4,10 @@ use std::path::{Path, PathBuf};
use bstr::{BStr, ByteSlice};
use gix_hash::oid;
-use super::Cache;
+use super::Stack;
use crate::PathIdMapping;
-/// Various aggregate numbers collected from when the corresponding [`Cache`] was instantiated.
+/// Various aggregate numbers collected from when the corresponding [`Stack`] was instantiated.
#[derive(Default, Clone, Copy, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Statistics {
@@ -16,6 +16,7 @@ pub struct Statistics {
/// Information about the stack delegate.
pub delegate: delegate::Statistics,
/// Information about attributes
+ #[cfg(feature = "attributes")]
pub attributes: state::attributes::Statistics,
/// Information about the ignore stack
pub ignore: state::ignore::Statistics,
@@ -24,6 +25,7 @@ pub struct Statistics {
#[derive(Clone)]
pub enum State {
/// Useful for checkout where directories need creation, but we need to access attributes as well.
+ #[cfg(feature = "attributes")]
CreateDirectoryAndAttributesStack {
/// If there is a symlink or a file in our path, try to unlink it before creating the directory.
unlink_on_collision: bool,
@@ -31,24 +33,28 @@ pub enum State {
attributes: state::Attributes,
},
/// Used when adding files, requiring access to both attributes and ignore information, for example during add operations.
+ #[cfg(feature = "attributes")]
AttributesAndIgnoreStack {
/// State to handle attribute information
attributes: state::Attributes,
/// State to handle exclusion information
ignore: state::Ignore,
},
+ /// Used when only attributes are required, typically with fully virtual worktrees.
+ #[cfg(feature = "attributes")]
+ AttributesStack(state::Attributes),
/// Used when providing worktree status information.
IgnoreStack(state::Ignore),
}
#[must_use]
pub struct Platform<'a> {
- parent: &'a Cache,
+ parent: &'a Stack,
is_dir: Option<bool>,
}
/// Initialization
-impl Cache {
+impl Stack {
/// Create a new instance with `worktree_root` being the base for all future paths we match.
/// `state` defines the capabilities of the cache.
/// The `case` configures attribute and exclusion case sensitivity at *query time*, which should match the case that
@@ -62,7 +68,7 @@ impl Cache {
id_mappings: Vec<PathIdMapping>,
) -> Self {
let root = worktree_root.into();
- Cache {
+ Stack {
stack: gix_fs::Stack::new(root),
state,
case,
@@ -74,19 +80,19 @@ impl Cache {
}
/// Entry points for attribute query
-impl Cache {
+impl Stack {
/// Append the `relative` path to the root directory of the cache and efficiently create leading directories, while assuring that no
/// symlinks are in that path.
/// Unless `is_dir` is known with `Some(…)`, then `relative` points to a directory itself in which case the entire resulting
/// path is created as directory. If it's not known it is assumed to be a file.
- /// `find` maybe used to lookup objects from an [id mapping][crate::cache::State::id_mappings_from_index()], with mappnigs
+ /// `find` maybe used to lookup objects from an [id mapping][crate::stack::State::id_mappings_from_index()], with mappnigs
///
/// Provide access to cached information for that `relative` path via the returned platform.
pub fn at_path<Find, E>(
&mut self,
relative: impl AsRef<Path>,
is_dir: Option<bool>,
- find: Find,
+ mut find: Find,
) -> std::io::Result<Platform<'_>>
where
Find: for<'a> FnMut(&oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E>,
@@ -98,17 +104,18 @@ impl Cache {
buf: &mut self.buf,
is_dir: is_dir.unwrap_or(false),
id_mappings: &self.id_mappings,
- find,
+ find: &mut |oid, buf| Ok(find(oid, buf).map_err(Box::new)?),
case: self.case,
statistics: &mut self.statistics,
};
- self.stack.make_relative_path_current(relative, &mut delegate)?;
+ self.stack
+ .make_relative_path_current(relative.as_ref(), &mut delegate)?;
Ok(Platform { parent: self, is_dir })
}
/// Obtain a platform for lookups from a repo-`relative` path, typically obtained from an index entry. `is_dir` should reflect
/// whether it's a directory or not, or left at `None` if unknown.
- /// `find` maybe used to lookup objects from an [id mapping][crate::cache::State::id_mappings_from_index()].
+ /// `find` maybe used to lookup objects from an [id mapping][crate::stack::State::id_mappings_from_index()].
/// All effects are similar to [`at_path()`][Self::at_path()].
///
/// If `relative` ends with `/` and `is_dir` is `None`, it is automatically assumed to be a directory.
@@ -138,7 +145,7 @@ impl Cache {
}
/// Mutation
-impl Cache {
+impl Stack {
/// Reset the statistics after returning them.
pub fn take_statistics(&mut self) -> Statistics {
std::mem::take(&mut self.statistics)
@@ -148,10 +155,16 @@ impl Cache {
pub fn state_mut(&mut self) -> &mut State {
&mut self.state
}
+
+ /// Change the `case` of the next match to the given one.
+ pub fn set_case(&mut self, case: gix_glob::pattern::Case) -> &mut Self {
+ self.case = case;
+ self
+ }
}
/// Access
-impl Cache {
+impl Stack {
/// Return the statistics we gathered thus far.
pub fn statistics(&self) -> &Statistics {
&self.statistics
diff --git a/vendor/gix-worktree/src/cache/platform.rs b/vendor/gix-worktree/src/stack/platform.rs
index 27d0bfbc8..3c6295f89 100644
--- a/vendor/gix-worktree/src/cache/platform.rs
+++ b/vendor/gix-worktree/src/stack/platform.rs
@@ -2,7 +2,7 @@ use std::path::Path;
use bstr::ByteSlice;
-use crate::cache::Platform;
+use crate::stack::Platform;
/// Access
impl<'a> Platform<'a> {
@@ -40,11 +40,12 @@ impl<'a> Platform<'a> {
/// # Panics
///
/// If the cache was configured without attributes.
+ #[cfg(feature = "attributes")]
pub fn matching_attributes(&self, out: &mut gix_attributes::search::Outcome) -> bool {
let attrs = self.parent.state.attributes_or_panic();
let relative_path =
gix_path::to_unix_separators_on_windows(gix_path::into_bstr(self.parent.stack.current_relative()));
- attrs.matching_attributes(relative_path.as_bstr(), self.parent.case, out)
+ attrs.matching_attributes(relative_path.as_bstr(), self.parent.case, self.is_dir, out)
}
}
diff --git a/vendor/gix-worktree/src/cache/state/attributes.rs b/vendor/gix-worktree/src/stack/state/attributes.rs
index c42e36f74..d49de1288 100644
--- a/vendor/gix-worktree/src/cache/state/attributes.rs
+++ b/vendor/gix-worktree/src/stack/state/attributes.rs
@@ -3,9 +3,10 @@ use std::path::{Path, PathBuf};
use bstr::{BStr, ByteSlice};
use gix_glob::pattern::Case;
+use crate::stack::delegate::FindFn;
use crate::{
- cache::state::{AttributeMatchGroup, Attributes},
- Cache, PathIdMapping,
+ stack::state::{AttributeMatchGroup, Attributes},
+ PathIdMapping, Stack,
};
/// Various aggregate numbers related [`Attributes`].
@@ -21,16 +22,17 @@ pub struct Statistics {
}
/// Decide where to read `.gitattributes` files from.
+///
+/// To Retrieve attribute files from id mappings, see
+/// [State::id_mappings_from_index()][crate::stack::State::id_mappings_from_index()].
+///
+/// These mappings are typically produced from an index.
+/// If a tree should be the source, build an attribute list from a tree instead, or convert a tree to an index.
+///
#[derive(Default, Debug, Clone, Copy)]
pub enum Source {
- /// Retrieve attribute files from id mappings, see
- /// [State::id_mappings_from_index()][crate::cache::State::id_mappings_from_index()].
- ///
- /// These mappings are typically produced from an index.
- /// If a tree should be the source, build an attribute list from a tree instead, or convert a tree to an index.
- ///
- /// Use this when no worktree checkout is available, like in bare repositories or when accessing blobs from other parts
- /// of the history which aren't checked out.
+ /// Use this when no worktree checkout is available, like in bare repositories, during clones, or when accessing blobs from
+ /// other parts of the history which aren't checked out.
#[default]
IdMapping,
/// Read from an id mappings and if not present, read from the worktree.
@@ -44,6 +46,17 @@ pub enum Source {
WorktreeThenIdMapping,
}
+impl Source {
+ /// Returns non-worktree variants of `self` if `is_bare` is true.
+ pub fn adjust_for_bare(self, is_bare: bool) -> Self {
+ if is_bare {
+ Source::IdMapping
+ } else {
+ self
+ }
+ }
+}
+
/// Initialization
impl Attributes {
/// Create a new instance from an attribute match group that represents `globals`. It can more easily be created with
@@ -75,20 +88,16 @@ impl Attributes {
}
#[allow(clippy::too_many_arguments)]
- pub(crate) fn push_directory<Find, E>(
+ pub(crate) fn push_directory(
&mut self,
root: &Path,
dir: &Path,
rela_dir: &BStr,
buf: &mut Vec<u8>,
id_mappings: &[PathIdMapping],
- mut find: Find,
+ find: &mut FindFn<'_>,
stats: &mut Statistics,
- ) -> std::io::Result<()>
- where
- Find: for<'b> FnMut(&gix_hash::oid, &'b mut Vec<u8>) -> Result<gix_object::BlobRef<'b>, E>,
- E: std::error::Error + Send + Sync + 'static,
- {
+ ) -> std::io::Result<()> {
let attr_path_relative =
gix_path::to_unix_separators_on_windows(gix_path::join_bstr_unix_pathsep(rela_dir, ".gitattributes"));
let attr_file_in_index = id_mappings.binary_search_by(|t| t.0.as_bstr().cmp(attr_path_relative.as_ref()));
@@ -157,7 +166,7 @@ impl Attributes {
// Need one stack level per component so push and pop matches, but only if this isn't the root level which is never popped.
if !added && self.info_attributes.is_none() {
self.stack
- .add_patterns_buffer(&[], Path::new("<empty dummy>"), None, &mut self.collection, true)
+ .add_patterns_buffer(&[], "<empty dummy>".into(), None, &mut self.collection, true)
}
// When reading the root, always the first call, we can try to also read the `.git/info/attributes` file which is
@@ -182,6 +191,7 @@ impl Attributes {
&self,
relative_path: &BStr,
case: Case,
+ is_dir: Option<bool>,
out: &mut gix_attributes::search::Outcome,
) -> bool {
// assure `out` is ready to deal with possibly changed collections (append-only)
@@ -190,7 +200,7 @@ impl Attributes {
let groups = [&self.globals, &self.stack];
let mut has_match = false;
groups.iter().rev().any(|group| {
- has_match |= group.pattern_matching_relative_path(relative_path, case, out);
+ has_match |= group.pattern_matching_relative_path(relative_path, case, is_dir, out);
out.is_done()
});
has_match
@@ -198,8 +208,12 @@ impl Attributes {
}
/// Attribute matching specific methods
-impl Cache {
+impl Stack {
/// Creates a new container to store match outcomes for all attribute matches.
+ ///
+ /// ### Panics
+ ///
+ /// If attributes aren't configured.
pub fn attribute_matches(&self) -> gix_attributes::search::Outcome {
let mut out = gix_attributes::search::Outcome::default();
out.initialize(&self.state.attributes_or_panic().collection);
@@ -207,6 +221,10 @@ impl Cache {
}
/// Creates a new container to store match outcomes for the given attributes.
+ ///
+ /// ### Panics
+ ///
+ /// If attributes aren't configured.
pub fn selected_attribute_matches<'a>(
&self,
given: impl IntoIterator<Item = impl Into<&'a str>>,
@@ -214,8 +232,18 @@ impl Cache {
let mut out = gix_attributes::search::Outcome::default();
out.initialize_with_selection(
&self.state.attributes_or_panic().collection,
- given.into_iter().map(|n| n.into()),
+ given.into_iter().map(Into::into),
);
out
}
+
+ /// Return the metadata collection that enables initializing attribute match outcomes as done in
+ /// [`attribute_matches()`][Stack::attribute_matches()] or [`selected_attribute_matches()`][Stack::selected_attribute_matches()]
+ ///
+ /// ### Panics
+ ///
+ /// If attributes aren't configured.
+ pub fn attributes_collection(&self) -> &gix_attributes::search::MetadataCollection {
+ &self.state.attributes_or_panic().collection
+ }
}
diff --git a/vendor/gix-worktree/src/cache/state/ignore.rs b/vendor/gix-worktree/src/stack/state/ignore.rs
index dde98da55..e2a2d5a3d 100644
--- a/vendor/gix-worktree/src/cache/state/ignore.rs
+++ b/vendor/gix-worktree/src/stack/state/ignore.rs
@@ -3,8 +3,9 @@ use std::path::Path;
use bstr::{BStr, ByteSlice};
use gix_glob::pattern::Case;
+use crate::stack::delegate::FindFn;
use crate::{
- cache::state::{Ignore, IgnoreMatchGroup},
+ stack::state::{Ignore, IgnoreMatchGroup},
PathIdMapping,
};
@@ -12,7 +13,7 @@ use crate::{
#[derive(Default, Debug, Clone, Copy)]
pub enum Source {
/// Retrieve ignore files from id mappings, see
- /// [State::id_mappings_from_index()][crate::cache::State::id_mappings_from_index()].
+ /// [State::id_mappings_from_index()][crate::stack::State::id_mappings_from_index()].
///
/// These mappings are typically produced from an index.
/// If a tree should be the source, build an attribute list from a tree instead, or convert a tree to an index.
@@ -25,6 +26,17 @@ pub enum Source {
WorktreeThenIdMappingIfNotSkipped,
}
+impl Source {
+ /// Returns non-worktree variants of `self` if `is_bare` is true.
+ pub fn adjust_for_bare(self, is_bare: bool) -> Self {
+ if is_bare {
+ Source::IdMapping
+ } else {
+ self
+ }
+ }
+}
+
/// Various aggregate numbers related [`Ignore`].
#[derive(Default, Clone, Copy, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
@@ -145,26 +157,21 @@ impl Ignore {
}
#[allow(clippy::too_many_arguments)]
- pub(crate) fn push_directory<Find, E>(
+ pub(crate) fn push_directory(
&mut self,
root: &Path,
dir: &Path,
rela_dir: &BStr,
buf: &mut Vec<u8>,
id_mappings: &[PathIdMapping],
- mut find: Find,
+ find: &mut FindFn<'_>,
case: Case,
stats: &mut Statistics,
- ) -> std::io::Result<()>
- where
- Find: for<'b> FnMut(&gix_hash::oid, &'b mut Vec<u8>) -> Result<gix_object::BlobRef<'b>, E>,
- E: std::error::Error + Send + Sync + 'static,
- {
+ ) -> std::io::Result<()> {
self.matched_directory_patterns_stack
.push(self.matching_exclude_pattern_no_dir(rela_dir, Some(true), case));
- let ignore_path_relative =
- gix_path::to_unix_separators_on_windows(gix_path::join_bstr_unix_pathsep(rela_dir, ".gitignore"));
+ let ignore_path_relative = gix_path::join_bstr_unix_pathsep(rela_dir, ".gitignore");
let ignore_file_in_index = id_mappings.binary_search_by(|t| t.0.as_bstr().cmp(ignore_path_relative.as_ref()));
match self.source {
Source::IdMapping => {
diff --git a/vendor/gix-worktree/src/cache/state/mod.rs b/vendor/gix-worktree/src/stack/state/mod.rs
index bdf504568..0b371425a 100644
--- a/vendor/gix-worktree/src/cache/state/mod.rs
+++ b/vendor/gix-worktree/src/stack/state/mod.rs
@@ -1,15 +1,15 @@
-use std::path::PathBuf;
-
use bstr::{BString, ByteSlice};
use gix_glob::pattern::Case;
-use crate::{cache::State, PathIdMapping};
+use crate::{stack::State, PathIdMapping};
+#[cfg(feature = "attributes")]
type AttributeMatchGroup = gix_attributes::Search;
type IgnoreMatchGroup = gix_ignore::Search;
/// State related to attributes associated with files in the repository.
#[derive(Default, Clone)]
+#[cfg(feature = "attributes")]
pub struct Attributes {
/// Attribute patterns which aren't tied to the repository root, hence are global, they contribute first.
globals: AttributeMatchGroup,
@@ -20,7 +20,7 @@ pub struct Attributes {
stack: AttributeMatchGroup,
/// The first time we push the root, we have to load additional information from this file if it exists along with the root attributes
/// file if possible, and keep them there throughout.
- info_attributes: Option<PathBuf>,
+ info_attributes: Option<std::path::PathBuf>,
/// A lookup table to accelerate searches.
collection: gix_attributes::search::MetadataCollection,
/// Where to read `.gitattributes` data from.
@@ -50,6 +50,7 @@ pub struct Ignore {
}
///
+#[cfg(feature = "attributes")]
pub mod attributes;
///
pub mod ignore;
@@ -57,6 +58,7 @@ pub mod ignore;
/// Initialization
impl State {
/// Configure a state to be suitable for checking out files, which only needs access to attribute files read from the index.
+ #[cfg(feature = "attributes")]
pub fn for_checkout(unlink_on_collision: bool, attributes: Attributes) -> Self {
State::CreateDirectoryAndAttributesStack {
unlink_on_collision,
@@ -65,6 +67,7 @@ impl State {
}
/// Configure a state for adding files, with support for ignore files and attribute files.
+ #[cfg(feature = "attributes")]
pub fn for_add(attributes: Attributes, ignore: Ignore) -> Self {
State::AttributesAndIgnoreStack { attributes, ignore }
}
@@ -93,25 +96,33 @@ impl State {
&self,
index: &gix_index::State,
paths: &gix_index::PathStorageRef,
- ignore_source: ignore::Source,
case: Case,
) -> Vec<PathIdMapping> {
let a1_backing;
+ #[cfg(feature = "attributes")]
let a2_backing;
let names = match self {
- State::IgnoreStack(v) => {
- a1_backing = [(v.exclude_file_name_for_directories.as_bytes().as_bstr(), true)];
+ State::IgnoreStack(ignore) => {
+ a1_backing = [(
+ ignore.exclude_file_name_for_directories.as_bytes().as_bstr(),
+ Some(ignore.source),
+ )];
a1_backing.as_ref()
}
+ #[cfg(feature = "attributes")]
State::AttributesAndIgnoreStack { ignore, .. } => {
a2_backing = [
- (ignore.exclude_file_name_for_directories.as_bytes().as_bstr(), true),
- (".gitattributes".into(), false),
+ (
+ ignore.exclude_file_name_for_directories.as_bytes().as_bstr(),
+ Some(ignore.source),
+ ),
+ (".gitattributes".into(), None),
];
a2_backing.as_ref()
}
- State::CreateDirectoryAndAttributesStack { .. } => {
- a1_backing = [(".gitattributes".into(), true)];
+ #[cfg(feature = "attributes")]
+ State::CreateDirectoryAndAttributesStack { .. } | State::AttributesStack(_) => {
+ a1_backing = [(".gitattributes".into(), None)];
a1_backing.as_ref()
}
};
@@ -126,15 +137,15 @@ impl State {
// there won't be a stage 0.
if entry.mode == gix_index::entry::Mode::FILE && (entry.stage() == 0 || entry.stage() == 2) {
let basename = path.rfind_byte(b'/').map_or(path, |pos| path[pos + 1..].as_bstr());
- let is_ignore = names.iter().find_map(|t| {
+ let ignore_source = names.iter().find_map(|t| {
match case {
Case::Sensitive => basename == t.0,
Case::Fold => basename.eq_ignore_ascii_case(t.0),
}
.then_some(t.1)
})?;
- if is_ignore {
- match ignore_source {
+ if let Some(source) = ignore_source {
+ match source {
ignore::Source::IdMapping => {}
ignore::Source::WorktreeThenIdMappingIfNotSkipped => {
// See https://github.com/git/git/blob/master/dir.c#L912:L912
@@ -155,16 +166,20 @@ impl State {
pub(crate) fn ignore_or_panic(&self) -> &Ignore {
match self {
State::IgnoreStack(v) => v,
+ #[cfg(feature = "attributes")]
State::AttributesAndIgnoreStack { ignore, .. } => ignore,
- State::CreateDirectoryAndAttributesStack { .. } => {
+ #[cfg(feature = "attributes")]
+ State::AttributesStack(_) | State::CreateDirectoryAndAttributesStack { .. } => {
unreachable!("BUG: must not try to check excludes without it being setup")
}
}
}
+ #[cfg(feature = "attributes")]
pub(crate) fn attributes_or_panic(&self) -> &Attributes {
match self {
- State::AttributesAndIgnoreStack { attributes, .. }
+ State::AttributesStack(attributes)
+ | State::AttributesAndIgnoreStack { attributes, .. }
| State::CreateDirectoryAndAttributesStack { attributes, .. } => attributes,
State::IgnoreStack(_) => {
unreachable!("BUG: must not try to check excludes without it being setup")
diff --git a/vendor/gix-worktree/src/status/content.rs b/vendor/gix-worktree/src/status/content.rs
deleted file mode 100644
index aa775821a..000000000
--- a/vendor/gix-worktree/src/status/content.rs
+++ /dev/null
@@ -1,80 +0,0 @@
-use gix_hash::ObjectId;
-use gix_index as index;
-use index::Entry;
-
-/// Compares the content of two blobs in some way.
-pub trait CompareBlobs {
- /// Output data produced by [`compare_blobs()`][CompareBlobs::compare_blobs()].
- type Output;
-
- /// Providing the underlying index `entry`, allow comparing a file in the worktree of size `worktree_blob_size`
- /// and allow reading its bytes using `worktree_blob`.
- /// If this function returns `None` the `entry` and the `worktree_blob` are assumed to be identical.
- /// Use `entry_blob` to obtain the data for the blob referred to by `entry`, allowing comparisons of the data itself.
- fn compare_blobs<'a, E>(
- &mut self,
- entry: &'a gix_index::Entry,
- worktree_blob_size: usize,
- worktree_blob: impl ReadDataOnce<'a, E>,
- entry_blob: impl ReadDataOnce<'a, E>,
- ) -> Result<Option<Self::Output>, E>;
-}
-
-/// Lazy borrowed access to blob data.
-pub trait ReadDataOnce<'a, E> {
- /// Returns the contents of this blob.
- ///
- /// This potentially performs IO and other expensive operations
- /// and should only be called when necessary.
- fn read_data(self) -> Result<&'a [u8], E>;
-}
-
-/// Compares to blobs by comparing their size and oid, and only looks at the file if
-/// the size matches, therefore it's very fast.
-#[derive(Clone)]
-pub struct FastEq;
-
-impl CompareBlobs for FastEq {
- type Output = ();
-
- fn compare_blobs<'a, E>(
- &mut self,
- entry: &'a Entry,
- worktree_blob_size: usize,
- worktree_blob: impl ReadDataOnce<'a, E>,
- _entry_blob: impl ReadDataOnce<'a, E>,
- ) -> Result<Option<Self::Output>, E> {
- // make sure to account for racily smudged entries here so that they don't always keep
- // showing up as modified even after their contents have changed again, to a potentially
- // unmodified state. That means that we want to ignore stat.size == 0 for non_empty_blobs.
- if entry.stat.size as usize != worktree_blob_size && (entry.id.is_empty_blob() || entry.stat.size != 0) {
- return Ok(Some(()));
- }
- let blob = worktree_blob.read_data()?;
- let file_hash = gix_object::compute_hash(entry.id.kind(), gix_object::Kind::Blob, blob);
- Ok((entry.id != file_hash).then_some(()))
- }
-}
-
-/// Compares files to blobs by *always* comparing their hashes.
-///
-/// Same as [`FastEq`] but does not contain a fast path for files with mismatched files and
-/// therefore always returns an OID that can be reused later.
-#[derive(Clone)]
-pub struct HashEq;
-
-impl CompareBlobs for HashEq {
- type Output = ObjectId;
-
- fn compare_blobs<'a, E>(
- &mut self,
- entry: &'a Entry,
- _worktree_blob_size: usize,
- worktree_blob: impl ReadDataOnce<'a, E>,
- _entry_blob: impl ReadDataOnce<'a, E>,
- ) -> Result<Option<Self::Output>, E> {
- let blob = worktree_blob.read_data()?;
- let file_hash = gix_object::compute_hash(entry.id.kind(), gix_object::Kind::Blob, blob);
- Ok((entry.id != file_hash).then_some(file_hash))
- }
-}
diff --git a/vendor/gix-worktree/src/status/function.rs b/vendor/gix-worktree/src/status/function.rs
deleted file mode 100644
index 5e01628b4..000000000
--- a/vendor/gix-worktree/src/status/function.rs
+++ /dev/null
@@ -1,331 +0,0 @@
-use std::{io, marker::PhantomData, path::Path};
-
-use bstr::BStr;
-use filetime::FileTime;
-use gix_features::parallel::{in_parallel_if, Reduce};
-
-use crate::{
- read,
- status::{
- content,
- content::CompareBlobs,
- types::{Error, Options},
- Change, VisitEntry,
- },
-};
-
-/// Calculates the changes that need to be applied to an `index` to match the state of the `worktree` and makes them
-/// observable in `collector`, along with information produced by `compare` which gets to see blobs that may have changes.
-/// `options` are used to configure the operation.
-///
-/// Note that `index` is updated with the latest seen stat information from the worktree, and its timestamp is adjusted to
-/// the current time for which it will be considered fresh.
-///
-/// Note that this isn't technically quite what this function does as this also provides some additional information,
-/// like whether a file has conflicts, and files that were added with `git add` are shown as a special
-/// changes despite not technically requiring a change to the index since `git add` already added the file to the index.
-pub fn status<'index, T, Find, E>(
- index: &'index mut gix_index::State,
- worktree: &Path,
- collector: &mut impl VisitEntry<'index, ContentChange = T>,
- compare: impl CompareBlobs<Output = T> + Send + Clone,
- find: Find,
- options: Options,
-) -> Result<(), Error>
-where
- T: Send,
- E: std::error::Error + Send + Sync + 'static,
- Find: for<'a> FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Send + Clone,
-{
- // the order is absolutely critical here we use the old timestamp to detect racy index entries
- // (modified at or after the last index update) during the index update we then set those
- // entries size to 0 (see below) to ensure they keep showing up as racy and reset the timestamp.
- let timestamp = index.timestamp();
- index.set_timestamp(FileTime::now());
- let (chunk_size, thread_limit, _) = gix_features::parallel::optimize_chunk_size_and_thread_limit(
- 100,
- index.entries().len().into(),
- options.thread_limit,
- None,
- );
- let (entries, path_backing) = index.entries_mut_and_pathbacking();
- in_parallel_if(
- || true, // TODO: heuristic: when is parallelization not worth it?
- entries.chunks_mut(chunk_size),
- thread_limit,
- {
- let options = &options;
- move |_| {
- (
- State {
- buf: Vec::new(),
- odb_buf: Vec::new(),
- timestamp,
- path_backing,
- worktree,
- options,
- },
- compare.clone(),
- find.clone(),
- )
- }
- },
- |entries, (state, diff, find)| {
- entries
- .iter_mut()
- .filter_map(|entry| state.process(entry, diff, find))
- .collect()
- },
- ReduceChange {
- collector,
- phantom: PhantomData,
- },
- )
-}
-
-struct State<'a, 'b> {
- buf: Vec<u8>,
- odb_buf: Vec<u8>,
- timestamp: FileTime,
- // path_cache: fs::Cache TODO path cache
- path_backing: &'b [u8],
- worktree: &'a Path,
- options: &'a Options,
-}
-
-type StatusResult<'index, T> = Result<(&'index gix_index::Entry, &'index BStr, Option<Change<T>>, bool), Error>;
-
-impl<'index> State<'_, 'index> {
- fn process<T, Find, E>(
- &mut self,
- entry: &'index mut gix_index::Entry,
- diff: &mut impl CompareBlobs<Output = T>,
- find: &mut Find,
- ) -> Option<StatusResult<'index, T>>
- where
- E: std::error::Error + Send + Sync + 'static,
- Find: for<'a> FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Send + Clone,
- {
- let conflict = match entry.stage() {
- 0 => false,
- 1 => true,
- _ => return None,
- };
- if entry.flags.intersects(
- gix_index::entry::Flags::UPTODATE
- | gix_index::entry::Flags::SKIP_WORKTREE
- | gix_index::entry::Flags::ASSUME_VALID
- | gix_index::entry::Flags::FSMONITOR_VALID,
- ) {
- return None;
- }
- let path = entry.path_in(self.path_backing);
- let status = self.compute_status(&mut *entry, path, diff, find);
- Some(status.map(move |status| (&*entry, path, status, conflict)))
- }
-
- /// # On how racy-git is handled here
- ///
- /// Basically the racy detection is a safety mechanism that ensures we can always just compare the stat
- /// information between index and worktree and if they match we don't need to look at the content.
- /// This usually just works but if a file updates quickly we could run into the following situation:
- ///
- /// * save file version `A` from disk into worktree (git add)
- /// * file is changed so fast that the mtime doesn't change - *we only looks at seconds by default*
- /// * file contents change but file-size stays the same, so `"foo" -> "bar"` has the same size but different content
- ///
- /// Now both `mtime` and `size`, and all other stat information, is the same but the file has actually changed.
- /// This case is called *racily clean*. *The file should show up as changed but due to a data race it doesn't.*
- /// This is the racy git problem.
- ///
- /// To solve this we do the following trick: Whenever we modify the index, which includes `git status`, we save the
- /// current timestamp before the modification starts. This timestamp fundamentally represents a checkpoint of sorts.
- /// We "promise" ourselves that after the modification finishes all entries modified before this timestamp have the
- /// racy git problem resolved.
- ///
- /// So now when we modify the index we must resolve the racy git problem somehow. To do that we only need to look at
- /// unchanged entries. Changed entries are not interesting since they are already showing up as changed anyway so there
- /// isn't really a race-condition to worry about. This also explains why removing the `return` here doesn't have an apparent effect.
- /// This entire branch here is just the optimization of "don't even look at index entries where the stat hasn't changed".
- /// If we don't have this optimization the result shouldn't change, our status implementation will just be super slow :D
-
- /// We calculate whether this change is `racy_clean`, so if the last `timestamp` is before or the same as the `mtime` of the entry
- /// which is what `new_stat.is_racy(..)` does in the branch, and only if we are sure that there is no race condition
- /// do we `return` early. Since we don't `return` early we just do a full content comparison below,
- /// which always yields the correct result, there is no race condition there.
- ///
- /// If a file showed up as racily clean and didn't change then we don't need to do anything. After this status check is
- /// complete and the file won't show up as racily clean anymore, since it's mtime is now before the new timestamp.
- /// However if the file did actually change then we really ran into one of those rare race conditions in that case we,
- /// and git does the same, set the size of the file in the index to 0. This will always make the file show up as changed.
- /// This adds the need to treat all files of size 0 in the index as changed. This is not quite right of course because 0 sized files
- /// could be entirely valid and unchanged. Therefore this only applies if the oid doesn't match the oid of an empty file,
- /// which is a constant.
- ///
- /// Adapted from [here](https://github.com/Byron/gitoxide/pull/805#discussion_r1164676777).
- fn compute_status<T, Find, E>(
- &mut self,
- entry: &mut gix_index::Entry,
- git_path: &BStr,
- diff: &mut impl CompareBlobs<Output = T>,
- find: &mut Find,
- ) -> Result<Option<Change<T>>, Error>
- where
- E: std::error::Error + Send + Sync + 'static,
- Find: for<'a> FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E> + Send + Clone,
- {
- // TODO fs cache
- let worktree_path = gix_path::try_from_bstr(git_path).map_err(|_| Error::IllformedUtf8)?;
- let worktree_path = self.worktree.join(worktree_path);
- let metadata = match worktree_path.symlink_metadata() {
- // TODO: check if any parent directory is a symlink
- // we need to use fs::Cache for that
- Ok(metadata) if metadata.is_dir() => {
- // index entries are normally only for files/symlinks
- // if a file turned into a directory it was removed
- // the only exception here are submodules which are
- // part of the index despite being directories
- //
- // TODO: submodules:
- // if entry.mode.contains(Mode::COMMIT) &&
- // resolve_gitlink_ref(ce->name, "HEAD", &sub))
- return Ok(Some(Change::Removed));
- }
- Ok(metadata) => metadata,
- Err(err) if err.kind() == io::ErrorKind::NotFound => return Ok(Some(Change::Removed)),
- Err(err) => {
- return Err(err.into());
- }
- };
- if entry.flags.contains(gix_index::entry::Flags::INTENT_TO_ADD) {
- return Ok(Some(Change::IntentToAdd));
- }
- let new_stat = gix_index::entry::Stat::from_fs(&metadata)?;
- let executable_bit_changed =
- match entry
- .mode
- .change_to_match_fs(&metadata, self.options.fs.symlink, self.options.fs.executable_bit)
- {
- Some(gix_index::entry::mode::Change::Type { .. }) => return Ok(Some(Change::Type)),
- Some(gix_index::entry::mode::Change::ExecutableBit) => true,
- None => false,
- };
-
- // Here we implement racy-git. See racy-git.txt in the git documentation for a detailed documentation.
- //
- // A file is racy if:
- // 1. its `mtime` is at or after the last index timestamp and its entry stat information
- // matches the on-disk file but the file contents are actually modified
- // 2. it's size is 0 (set after detecting a file was racy previously)
- //
- // The first case is detected below by checking the timestamp if the file is marked unmodified.
- // The second case is usually detected either because the on-disk file is not empty, hence
- // the basic stat match fails, or by checking whether the size doesn't fit the oid.
- let mut racy_clean = false;
- if !executable_bit_changed
- && new_stat.matches(&entry.stat, self.options.stat)
- // TODO: find a test for the following line or remove it. Is this more often hit with smudge/clean filters?
- && (!entry.id.is_empty_blob() || entry.stat.size == 0)
- {
- racy_clean = new_stat.is_racy(self.timestamp, self.options.stat);
- if !racy_clean {
- return Ok(None);
- }
- }
-
- let read_file = WorktreeBlob {
- buf: &mut self.buf,
- path: &worktree_path,
- entry,
- options: self.options,
- };
- let read_blob = OdbBlob {
- buf: &mut self.odb_buf,
- id: &entry.id,
- find,
- };
- let content_change = diff.compare_blobs::<Error>(entry, metadata.len() as usize, read_file, read_blob)?;
- // This file is racy clean! Set the size to 0 so we keep detecting this as the file is updated.
- if content_change.is_some() && racy_clean {
- entry.stat.size = 0;
- }
- if content_change.is_some() || executable_bit_changed {
- Ok(Some(Change::Modification {
- executable_bit_changed,
- content_change,
- }))
- } else {
- // don't diff against this file next time since we know the file is unchanged.
- entry.stat = new_stat;
- Ok(None)
- }
- }
-}
-
-struct ReduceChange<'a, 'index, T: VisitEntry<'index>> {
- collector: &'a mut T,
- phantom: PhantomData<fn(&'index ())>,
-}
-
-impl<'index, T, C: VisitEntry<'index, ContentChange = T>> Reduce for ReduceChange<'_, 'index, C> {
- type Input = Vec<StatusResult<'index, T>>;
-
- type FeedProduce = ();
-
- type Output = ();
-
- type Error = Error;
-
- fn feed(&mut self, items: Self::Input) -> Result<Self::FeedProduce, Self::Error> {
- for item in items {
- let (entry, path, change, conflict) = item?;
- self.collector.visit_entry(entry, path, change, conflict);
- }
- Ok(())
- }
-
- fn finalize(self) -> Result<Self::Output, Self::Error> {
- Ok(())
- }
-}
-
-struct WorktreeBlob<'a> {
- buf: &'a mut Vec<u8>,
- path: &'a Path,
- entry: &'a gix_index::Entry,
- options: &'a Options,
-}
-
-struct OdbBlob<'a, Find, E>
-where
- E: std::error::Error + Send + Sync + 'static,
- Find: FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E>,
-{
- buf: &'a mut Vec<u8>,
- id: &'a gix_hash::oid,
- find: Find,
-}
-
-impl<'a> content::ReadDataOnce<'a, Error> for WorktreeBlob<'a> {
- fn read_data(self) -> Result<&'a [u8], Error> {
- let res = read::data_to_buf_with_meta(
- self.path,
- self.buf,
- self.entry.mode == gix_index::entry::Mode::SYMLINK,
- &self.options.fs,
- )?;
- Ok(res)
- }
-}
-
-impl<'a, Find, E> content::ReadDataOnce<'a, Error> for OdbBlob<'a, Find, E>
-where
- E: std::error::Error + Send + Sync + 'static,
- Find: FnMut(&gix_hash::oid, &'a mut Vec<u8>) -> Result<gix_object::BlobRef<'a>, E>,
-{
- fn read_data(mut self) -> Result<&'a [u8], Error> {
- (self.find)(self.id, self.buf)
- .map(|b| b.data)
- .map_err(move |err| Error::Find(Box::new(err)))
- }
-}
diff --git a/vendor/gix-worktree/src/status/mod.rs b/vendor/gix-worktree/src/status/mod.rs
deleted file mode 100644
index 8294a54e8..000000000
--- a/vendor/gix-worktree/src/status/mod.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-//! Changes between an index and a worktree.
-///
-mod types;
-pub use types::{Change, Error, Options, VisitEntry};
-
-mod recorder;
-pub use recorder::Recorder;
-
-///
-pub mod content;
-pub(crate) mod function;
diff --git a/vendor/gix-worktree/src/status/recorder.rs b/vendor/gix-worktree/src/status/recorder.rs
deleted file mode 100644
index ea10303ae..000000000
--- a/vendor/gix-worktree/src/status/recorder.rs
+++ /dev/null
@@ -1,27 +0,0 @@
-use bstr::BStr;
-use gix_index as index;
-
-use crate::status::{Change, VisitEntry};
-
-/// Convenience implementation of [`VisitEntry`] that collects all non-trivial changes into a `Vec`.
-#[derive(Debug, Default)]
-pub struct Recorder<'index, T = ()> {
- /// collected changes, index entries without conflicts or changes are excluded.
- pub records: Vec<(&'index BStr, Option<Change<T>>, bool)>,
-}
-
-impl<'index, T: Send> VisitEntry<'index> for Recorder<'index, T> {
- type ContentChange = T;
-
- fn visit_entry(
- &mut self,
- _entry: &'index index::Entry,
- rela_path: &'index BStr,
- status: Option<Change<Self::ContentChange>>,
- conflict: bool,
- ) {
- if conflict || status.is_some() {
- self.records.push((rela_path, status, conflict))
- }
- }
-}
diff --git a/vendor/gix-worktree/src/status/types.rs b/vendor/gix-worktree/src/status/types.rs
deleted file mode 100644
index 3d488d24e..000000000
--- a/vendor/gix-worktree/src/status/types.rs
+++ /dev/null
@@ -1,69 +0,0 @@
-use bstr::BStr;
-
-/// The error returned by [`status()`][crate::status()].
-#[derive(Debug, thiserror::Error)]
-#[allow(missing_docs)]
-pub enum Error {
- #[error("Could not convert path to UTF8")]
- IllformedUtf8,
- #[error("The clock was off when reading file related metadata after updating a file on disk")]
- Time(#[from] std::time::SystemTimeError),
- #[error("IO error while writing blob or reading file metadata or changing filetype")]
- Io(#[from] std::io::Error),
- #[error("Failed to obtain blob from object database")]
- Find(#[source] Box<dyn std::error::Error + Send + Sync + 'static>),
-}
-
-#[derive(Clone, Default)]
-/// Options that control how the index status with a worktree is computed.
-pub struct Options {
- /// Capabilities of the file system which affect the status computation.
- pub fs: gix_fs::Capabilities,
- /// If set, don't use more than this amount of threads.
- /// Otherwise, usually use as many threads as there are logical cores.
- /// A value of 0 is interpreted as no-limit
- pub thread_limit: Option<usize>,
- /// Options that control how stat comparisons are made when checking if a file is fresh.
- pub stat: gix_index::entry::stat::Options,
-}
-
-/// How an index entry needs to be changed to obtain the destination worktree state, i.e. `entry.apply(this_change) == worktree-entry`.
-#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
-pub enum Change<T = ()> {
- /// This corresponding file does not exist in the worktree anymore.
- Removed,
- /// The type of file changed compared to the worktree, i.e. a symlink s now a file.
- Type,
- /// This worktree file was modified in some form, like a permission change or content change or both,
- /// as compared to this entry.
- Modification {
- /// Indicates that one of the stat changes was an executable bit change
- /// which is a significant change itself.
- executable_bit_changed: bool,
- /// The output of the [`CompareBlobs`][crate::status::content::CompareBlobs] run on this entry.
- /// If there is no content change and only the executable bit
- /// changed than this is `None`.
- content_change: Option<T>,
- },
- /// An index entry that correspond to an untracked worktree file marked with `git add --intent-to-add`.
- ///
- /// This means it's not available in the object database yet or the index was created from,
- /// even though now an entry exists that represents the worktree file.
- IntentToAdd,
-}
-
-/// Observe changes by comparing an index entry to the worktree or another index.
-pub trait VisitEntry<'index> {
- /// Data generated by comparing an entry with a file.
- type ContentChange;
- /// Observe the `change` of `entry` at the repository-relative `rela_path`, indicating whether
- /// or not it has a `conflict`.
- /// If `change` is `None`, there is no change.
- fn visit_entry(
- &mut self,
- entry: &'index gix_index::Entry,
- rela_path: &'index BStr,
- change: Option<Change<Self::ContentChange>>,
- conflict: bool,
- );
-}
diff --git a/vendor/gix-worktree/src/untracked.rs b/vendor/gix-worktree/src/untracked.rs
deleted file mode 100644
index 6e77d7fa3..000000000
--- a/vendor/gix-worktree/src/untracked.rs
+++ /dev/null
@@ -1 +0,0 @@
-// TODO: untracked file detection, needs fs::Cache