summaryrefslogtreecommitdiffstats
path: root/vendor/gix-fs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix-fs')
-rw-r--r--vendor/gix-fs/.cargo-checksum.json2
-rw-r--r--vendor/gix-fs/CHANGELOG.md292
-rw-r--r--vendor/gix-fs/Cargo.toml20
-rw-r--r--vendor/gix-fs/LICENSE-MIT2
-rw-r--r--vendor/gix-fs/src/stack.rs1
-rw-r--r--vendor/gix-fs/tests/capabilities/mod.rs18
-rw-r--r--vendor/gix-fs/tests/dir/create.rs194
-rw-r--r--vendor/gix-fs/tests/dir/mod.rs2
-rw-r--r--vendor/gix-fs/tests/dir/remove.rs146
-rw-r--r--vendor/gix-fs/tests/fs.rs4
-rw-r--r--vendor/gix-fs/tests/stack/mod.rs145
11 files changed, 19 insertions, 807 deletions
diff --git a/vendor/gix-fs/.cargo-checksum.json b/vendor/gix-fs/.cargo-checksum.json
index a75b830de..480a07f56 100644
--- a/vendor/gix-fs/.cargo-checksum.json
+++ b/vendor/gix-fs/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"23356c80c3cfba487eea05087c3aa030696f7b9883c431d7c3a03e2135004810","Cargo.toml":"eb6e0c419a8cabbc99d72b3dc2021e7eca30fcf6ba24c5459308c192aaf57c3f","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/capabilities.rs":"a784f08597dbfed3f42c5ef028b288cf97fc6b64bcb75e6c8f4e43668c88d6fb","src/dir/create.rs":"a0684526b608bec00ec9bc77ac58cf8ae39a65678f6c4d1ad39b1c0801202923","src/dir/mod.rs":"bf7413a8cc754d8921159d830d8df5b532e9b50aac708c24d6865b4e4b39c788","src/dir/remove.rs":"baead58ddea10770a46cc0822572b8cb21f3085ec692efb1bcd27919b622e4c7","src/lib.rs":"42f5434fd415a9616773ac585a333be6b7cf894a92bf8620014e8c8881d9c842","src/snapshot.rs":"436c8c5b72bc0b10f22a58e80304ae8e479a877007f7acb7746ae278417d239a","src/stack.rs":"c431124f93d17b0984640ebdcba6d9b8662f0e9a36feda33bc6b74fa6df4b872","src/symlink.rs":"8e69a221190d82cf97ebbbdf7acc1443e1329aaa9d5ec614d49f13388f253bdf","tests/capabilities/mod.rs":"5925cb271fc616225c0b0ef7f1c03247e33b10bc799c50774f29891bd5b2dde0","tests/dir/create.rs":"6943308c9509b3dfffa0fafd633ecf531d95ca2a6b5893ec54ae9a3f9bf2d91e","tests/dir/mod.rs":"0655b7cfcce3dc4e28e9e854564ab2532942582ff4da2f375a930888615651da","tests/dir/remove.rs":"83b2c265820192946f0c429aeb59c9fc212247df99868578bd7f28730730320d","tests/fs.rs":"313928b6aef5f194231f40c93aea015ef44d27d356eb6979fc8cfa34126160ca","tests/stack/mod.rs":"9f6cb3a0c8bd75584c18b58811b1a264df6fed79f0d22ea39ffe08e68a3f15d1"},"package":"8cd171c0cae97cd0dc57e7b4601cb1ebf596450e263ef3c02be9107272c877bd"} \ No newline at end of file
+{"files":{"Cargo.toml":"cda3c8a84daa3ce65f2cdc1b5835150b6ce592d7ff870cf9ed3bade4873830da","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"6f610e51b59dfbcbee281f58cc6d963bf716199dc7384dbaa94ccc3a6e343ce6","src/capabilities.rs":"a784f08597dbfed3f42c5ef028b288cf97fc6b64bcb75e6c8f4e43668c88d6fb","src/dir/create.rs":"a0684526b608bec00ec9bc77ac58cf8ae39a65678f6c4d1ad39b1c0801202923","src/dir/mod.rs":"bf7413a8cc754d8921159d830d8df5b532e9b50aac708c24d6865b4e4b39c788","src/dir/remove.rs":"baead58ddea10770a46cc0822572b8cb21f3085ec692efb1bcd27919b622e4c7","src/lib.rs":"42f5434fd415a9616773ac585a333be6b7cf894a92bf8620014e8c8881d9c842","src/snapshot.rs":"436c8c5b72bc0b10f22a58e80304ae8e479a877007f7acb7746ae278417d239a","src/stack.rs":"3f9510be2fe575b8ceb239535b81c27674c6e11f70401f78c5a01fd9c4c0fc7a","src/symlink.rs":"8e69a221190d82cf97ebbbdf7acc1443e1329aaa9d5ec614d49f13388f253bdf"},"package":"20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107"} \ No newline at end of file
diff --git a/vendor/gix-fs/CHANGELOG.md b/vendor/gix-fs/CHANGELOG.md
deleted file mode 100644
index 2c318cc40..000000000
--- a/vendor/gix-fs/CHANGELOG.md
+++ /dev/null
@@ -1,292 +0,0 @@
-# Changelog
-
-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.8.0 (2023-10-12)
-
-A maintenance release without user-facing changes.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 1 commit contributed to the release.
- - 17 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 ([`1347a54`](https://github.com/Byron/gitoxide/commit/1347a54f84599d8f0aa935d6e64b16c2298d25cf))
-</details>
-
-## 0.7.0 (2023-09-24)
-
-### New Features
-
- - <csr-id-7a96a258cc8a5bad6414367cdbce390b7ac88b19/> add `DerefMut` implementation for `FileSnapshot`.
- This allows to leverage `make_mut()`.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 4 commits contributed to the release over the course of 1 calendar day.
- - 16 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-features v0.35.0, gix-actor v0.27.0, gix-object v0.37.0, gix-glob v0.13.0, gix-attributes v0.19.0, gix-filter v0.5.0, gix-fs v0.7.0, gix-commitgraph v0.21.0, gix-revwalk v0.8.0, gix-traverse v0.33.0, gix-worktree-stream v0.5.0, gix-archive v0.5.0, gix-tempfile v10.0.0, gix-lock v10.0.0, gix-ref v0.37.0, gix-config v0.30.0, gix-url v0.24.0, gix-credentials v0.20.0, gix-diff v0.36.0, gix-discover v0.25.0, gix-ignore v0.8.0, gix-index v0.25.0, gix-mailmap v0.19.0, gix-negotiate v0.8.0, gix-pack v0.43.0, gix-odb v0.53.0, gix-pathspec v0.3.0, gix-transport v0.37.0, gix-protocol v0.40.0, gix-revision v0.22.0, gix-refspec v0.18.0, gix-status v0.1.0, gix-submodule v0.4.0, gix-worktree v0.26.0, gix-worktree-state v0.3.0, gix v0.54.0, gitoxide-core v0.32.0, gitoxide v0.30.0, safety bump 37 crates ([`7891fb1`](https://github.com/Byron/gitoxide/commit/7891fb17348ec2f4c997665f9a25be36e2713da4))
- - Prepare changelogs prior to release ([`8a60d5b`](https://github.com/Byron/gitoxide/commit/8a60d5b80877c213c3b646d3061e8a33e0e433ec))
- - Merge branch 'reset' ([`54a8495`](https://github.com/Byron/gitoxide/commit/54a849545140f7f1c0c7564c418071c0a76a34e7))
- - Add `DerefMut` implementation for `FileSnapshot`. ([`7a96a25`](https://github.com/Byron/gitoxide/commit/7a96a258cc8a5bad6414367cdbce390b7ac88b19))
-</details>
-
-## 0.6.0 (2023-09-08)
-
-### 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/>
-
- - 5 commits contributed to the release over the course of 17 calendar days.
- - 17 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.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 `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 'gix-submodule' ([`363ee77`](https://github.com/Byron/gitoxide/commit/363ee77400805f473c9ad66eadad9214e7ab66f4))
-</details>
-
-## 0.5.0 (2023-08-22)
-
-### New Features
-
- - <csr-id-2650843c19ba2f41fe188c7db93c3536e19b2507/> add `FileSnapshot::new()` to create free-floating instances.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 4 commits contributed to the release over the course of 1 calendar day.
- - 30 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.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 'submodule-in-gix' ([`36f7b78`](https://github.com/Byron/gitoxide/commit/36f7b783c67b8a087076a130f5ee9b90b23bc3cc))
- - Add `FileSnapshot::new()` to create free-floating instances. ([`2650843`](https://github.com/Byron/gitoxide/commit/2650843c19ba2f41fe188c7db93c3536e19b2507))
-</details>
-
-## 0.4.1 (2023-07-22)
-
-### New Features
-
- - <csr-id-a9eab8d59442be19e05be4912c756188675b2bda/> add `is_executable()` function to determine if metadata of a file is executable.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 7 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-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))
- - Add `is_executable()` function to determine if metadata of a file is executable. ([`a9eab8d`](https://github.com/Byron/gitoxide/commit/a9eab8d59442be19e05be4912c756188675b2bda))
- - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e))
-</details>
-
-## 0.4.0 (2023-07-19)
-
-A maintenance release without user-facing changes.
-
-### New Features
-
- - <csr-id-a9eab8d59442be19e05be4912c756188675b2bda/> add `is_executable()` function to determine if metadata of a file is executable.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 3 commits contributed to the release.
- - 26 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-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))
-</details>
-
-## 0.3.0 (2023-06-22)
-
-A maintenance release without user-facing changes.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 4 commits contributed to the release over the course of 5 calendar days.
- - 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**
- - 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))
-</details>
-
-## 0.2.0 (2023-06-06)
-
-<csr-id-dbc6cbb4363c2532f81b0bd6e351c4577bb9e9a3/>
-
-### Chore
-
- - <csr-id-dbc6cbb4363c2532f81b0bd6e351c4577bb9e9a3/> inline format args
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 9 commits contributed to the release over the course of 12 calendar days.
- - 41 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.5.1, gix-hash v0.11.2, gix-features v0.30.0, gix-actor v0.21.0, gix-path v0.8.1, gix-glob v0.8.0, gix-quote v0.4.4, gix-attributes v0.13.0, gix-chunk v0.4.2, gix-commitgraph v0.16.0, gix-config-value v0.12.1, gix-fs v0.2.0, gix-tempfile v6.0.0, gix-utils v0.1.2, gix-lock v6.0.0, gix-validate v0.7.5, gix-object v0.30.0, gix-ref v0.30.0, gix-sec v0.8.1, gix-config v0.23.0, gix-command v0.2.5, gix-prompt v0.5.1, gix-url v0.19.0, gix-credentials v0.15.0, gix-diff v0.30.0, gix-discover v0.19.0, gix-hashtable v0.2.1, gix-ignore v0.3.0, gix-bitmap v0.2.4, gix-traverse v0.26.0, gix-index v0.17.0, gix-mailmap v0.13.0, gix-revision v0.15.0, gix-negotiate v0.2.0, gix-pack v0.36.0, gix-odb v0.46.0, gix-packetline v0.16.2, gix-transport v0.32.0, gix-protocol v0.33.0, gix-refspec v0.11.0, gix-worktree v0.18.0, gix v0.45.0, safety bump 29 crates ([`9a9fa96`](https://github.com/Byron/gitoxide/commit/9a9fa96fa8a722bddc5c3b2270b0edf8f6615141))
- - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b))
- - Merge branch 'fix-docs' ([`420553a`](https://github.com/Byron/gitoxide/commit/420553a10d780e0b2dc466cac120989298a5f187))
- - Cleaning up documentation ([`2578e57`](https://github.com/Byron/gitoxide/commit/2578e576bfa365d194a23a1fb0bf09be230873de))
- - Merge branch 'main' into auto-clippy ([`3ef5c90`](https://github.com/Byron/gitoxide/commit/3ef5c90aebce23385815f1df674c1d28d58b4b0d))
- - Merge pull request #864 from nyurik/lint-fmt ([`279dc09`](https://github.com/Byron/gitoxide/commit/279dc09446f41d7f1d76350fbfafb444e53cd7da))
- - Merge branch 'blinxen/main' ([`9375cd7`](https://github.com/Byron/gitoxide/commit/9375cd75b01aa22a0e2eed6305fe45fabfd6c1ac))
- - Inline format args ([`dbc6cbb`](https://github.com/Byron/gitoxide/commit/dbc6cbb4363c2532f81b0bd6e351c4577bb9e9a3))
- - Include license files in all crates ([`facaaf6`](https://github.com/Byron/gitoxide/commit/facaaf633f01c857dcf2572c6dbe0a92b7105c1c))
-</details>
-
-## 0.1.1 (2023-04-26)
-
-A maintenance release without user-facing changes.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 4 commits contributed to the release over the course of 1 calendar day.
- - 7 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-hash v0.11.1, gix-path v0.7.4, gix-glob v0.6.0, gix-attributes v0.11.0, gix-config-value v0.11.0, gix-fs v0.1.1, gix-tempfile v5.0.3, gix-utils v0.1.1, gix-lock v5.0.1, gix-object v0.29.1, gix-ref v0.28.0, gix-sec v0.7.0, gix-config v0.21.0, gix-prompt v0.4.0, gix-url v0.17.0, gix-credentials v0.13.0, gix-diff v0.29.0, gix-discover v0.17.0, gix-hashtable v0.2.0, gix-ignore v0.1.0, gix-bitmap v0.2.3, gix-traverse v0.25.0, gix-index v0.16.0, gix-mailmap v0.12.0, gix-pack v0.34.0, gix-odb v0.44.0, gix-packetline v0.16.0, gix-transport v0.30.0, gix-protocol v0.31.0, gix-revision v0.13.0, gix-refspec v0.10.0, gix-worktree v0.16.0, gix v0.44.0, safety bump 7 crates ([`91134a1`](https://github.com/Byron/gitoxide/commit/91134a11c8ba0e942f692488ec9bce9fa1086324))
- - Prepare changelogs prior to release ([`30a1a71`](https://github.com/Byron/gitoxide/commit/30a1a71f36f24faac0e0b362ffdfedea7f9cdbf1))
- - Merge branch 'index-entries-attrs' ([`f37a930`](https://github.com/Byron/gitoxide/commit/f37a930aefa27e67f0b693ba9669cc26d49044fa))
- - Add remaining docs to get `gix-fs` into 'early' mode. ([`5783df2`](https://github.com/Byron/gitoxide/commit/5783df24df627cf6993a59e5dbaedef4e31a2d0b))
-</details>
-
-## 0.1.0 (2023-04-19)
-
-The initial release.
-
-### Commit Statistics
-
-<csr-read-only-do-not-edit/>
-
- - 7 commits contributed to the release over the course of 2 calendar days.
- - 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-fs v0.1.0 ([`1d64ef6`](https://github.com/Byron/gitoxide/commit/1d64ef65258ffd693a1d42d1c15f33e7e86f4464))
- - Fix `gix-fs` manifest ([`d1c7605`](https://github.com/Byron/gitoxide/commit/d1c7605fc9deb3f4bbdafa043ecc6523a6917de0))
- - Release gix-utils v0.1.0, gix-hash v0.11.0, gix-date v0.5.0, gix-features v0.29.0, gix-actor v0.20.0, gix-object v0.29.0, gix-archive v0.1.0, gix-fs v0.1.0, safety bump 25 crates ([`8dbd0a6`](https://github.com/Byron/gitoxide/commit/8dbd0a60557a85acfa231800a058cbac0271a8cf))
- - Prepare changelog prior to release ([`7f06458`](https://github.com/Byron/gitoxide/commit/7f064583bd0e1b078df89a7750f5a25deb70f516))
- - Make fmt ([`5d2b5d0`](https://github.com/Byron/gitoxide/commit/5d2b5d02c3869e07dc2507a8f2519ee1df633df7))
- - Merge branch 'main' into dev ([`cdef398`](https://github.com/Byron/gitoxide/commit/cdef398c4a3bd01baf0be2c27a3f77a400172b0d))
- - Create new `gix-fs` crate to consolidate all filesystem utilities ([`f8cc33c`](https://github.com/Byron/gitoxide/commit/f8cc33cb372dd2b4bbe4a09cf4f64916681ab1dd))
-</details>
-
diff --git a/vendor/gix-fs/Cargo.toml b/vendor/gix-fs/Cargo.toml
index 996ced187..d3907f9ff 100644
--- a/vendor/gix-fs/Cargo.toml
+++ b/vendor/gix-fs/Cargo.toml
@@ -13,8 +13,12 @@
edition = "2021"
rust-version = "1.65"
name = "gix-fs"
-version = "0.8.0"
+version = "0.8.1"
authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"]
+include = [
+ "src/**/*",
+ "LICENSE-*",
+]
description = "A crate providing file system specific utilities to `gitoxide`"
license = "MIT OR Apache-2.0"
repository = "https://github.com/Byron/gitoxide"
@@ -23,7 +27,19 @@ repository = "https://github.com/Byron/gitoxide"
doctest = false
[dependencies.gix-features]
-version = "^0.36.0"
+version = "^0.36.1"
+
+[dependencies.serde]
+version = "1.0.114"
+features = [
+ "std",
+ "derive",
+]
+optional = true
+default-features = false
[dev-dependencies.tempfile]
version = "3.5.0"
+
+[features]
+serde = ["dep:serde"]
diff --git a/vendor/gix-fs/LICENSE-MIT b/vendor/gix-fs/LICENSE-MIT
index b58e818f1..97c2fa7d8 100644
--- a/vendor/gix-fs/LICENSE-MIT
+++ b/vendor/gix-fs/LICENSE-MIT
@@ -1,5 +1,3 @@
-MIT License
-
Copyright (c) 2018-2021 Sebastian Thiel, and [contributors](https://github.com/byron/gitoxide/contributors).
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/vendor/gix-fs/src/stack.rs b/vendor/gix-fs/src/stack.rs
index d90d662ca..5d3dfeccd 100644
--- a/vendor/gix-fs/src/stack.rs
+++ b/vendor/gix-fs/src/stack.rs
@@ -63,7 +63,6 @@ impl Stack {
relative.is_relative(),
"only index paths are handled correctly here, must be relative"
);
- debug_assert!(!relative.to_string_lossy().is_empty(), "empty paths are not allowed");
if self.valid_components == 0 {
delegate.push_directory(self)?;
diff --git a/vendor/gix-fs/tests/capabilities/mod.rs b/vendor/gix-fs/tests/capabilities/mod.rs
deleted file mode 100644
index ba02d09c0..000000000
--- a/vendor/gix-fs/tests/capabilities/mod.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#[test]
-fn probe() {
- let dir = tempfile::tempdir().unwrap();
- std::fs::File::create(dir.path().join("config")).unwrap();
- let ctx = gix_fs::Capabilities::probe(dir.path());
- dbg!(ctx);
- let entries: Vec<_> = std::fs::read_dir(dir.path())
- .unwrap()
- .filter_map(Result::ok)
- .filter(|e| e.file_name().to_str() != Some("config"))
- .map(|e| e.path())
- .collect();
- assert_eq!(
- entries.len(),
- 0,
- "there should be no left-over files after probing, found {entries:?}"
- );
-}
diff --git a/vendor/gix-fs/tests/dir/create.rs b/vendor/gix-fs/tests/dir/create.rs
deleted file mode 100644
index 6693fd071..000000000
--- a/vendor/gix-fs/tests/dir/create.rs
+++ /dev/null
@@ -1,194 +0,0 @@
-mod all {
- use gix_fs::dir::create;
-
- #[test]
- fn a_deeply_nested_directory() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let target = &dir.path().join("1").join("2").join("3").join("4").join("5").join("6");
- let dir = create::all(target, Default::default())?;
- assert_eq!(dir, target, "all subdirectories can be created");
- Ok(())
- }
-}
-mod iter {
- pub use std::io::ErrorKind::*;
-
- use gix_fs::dir::{
- create,
- create::{Error::*, Retries},
- };
-
- #[test]
- fn an_existing_directory_causes_immediate_success() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let mut it = create::Iter::new(dir.path());
- assert_eq!(
- it.next().expect("item").expect("success"),
- dir.path(),
- "first iteration is immediately successful"
- );
- assert!(it.next().is_none(), "iterator exhausted afterwards");
- Ok(())
- }
-
- #[test]
- fn a_single_directory_can_be_created_too() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("new");
- let mut it = create::Iter::new(&new_dir);
- assert_eq!(
- it.next().expect("item").expect("success"),
- &new_dir,
- "first iteration is immediately successful"
- );
- assert!(it.next().is_none(), "iterator exhausted afterwards");
- assert!(new_dir.is_dir(), "the directory exists");
- Ok(())
- }
-
- #[test]
- fn multiple_intermediate_directories_are_created_automatically() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("s1").join("s2").join("new");
- let mut it = create::Iter::new(&new_dir);
- assert!(
- matches!(it.next(), Some(Err(Intermediate{dir, kind: k})) if k == NotFound && dir == new_dir),
- "dir is not present"
- );
- assert!(
- matches!(it.next(), Some(Err(Intermediate{dir, kind:k})) if k == NotFound && dir == new_dir.parent().unwrap()),
- "parent dir is not present"
- );
- assert_eq!(
- it.next().expect("item").expect("success"),
- new_dir.parent().unwrap().parent().unwrap(),
- "first subdir is created"
- );
- assert_eq!(
- it.next().expect("item").expect("success"),
- new_dir.parent().unwrap(),
- "second subdir is created"
- );
- assert_eq!(
- it.next().expect("item").expect("success"),
- new_dir,
- "target directory is created"
- );
- assert!(it.next().is_none(), "iterator depleted");
- assert!(new_dir.is_dir(), "the directory exists");
- Ok(())
- }
-
- #[test]
- fn multiple_intermediate_directories_are_created_up_to_retries_limit() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("s1").join("s2").join("new");
- let mut it = create::Iter::new_with_retries(
- &new_dir,
- Retries {
- on_create_directory_failure: 1,
- ..Default::default()
- },
- );
- assert!(
- matches!(it.next(), Some(Err(Permanent{ retries_left, dir, err, ..})) if retries_left.on_create_directory_failure == 0
- && err.kind() == NotFound
- && dir == new_dir),
- "parent dir is not present and we run out of attempts"
- );
- assert!(it.next().is_none(), "iterator depleted");
- assert!(!new_dir.is_dir(), "the wasn't created");
- Ok(())
- }
-
- #[test]
- fn an_existing_file_makes_directory_creation_fail_permanently() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("also-file");
- std::fs::write(&new_dir, [42])?;
- assert!(new_dir.is_file());
-
- let mut it = create::Iter::new(&new_dir);
- assert!(
- matches!(it.next(), Some(Err(Permanent{ dir, err, .. })) if err.kind() == AlreadyExists
- && dir == new_dir),
- "parent dir is not present and we run out of attempts"
- );
- assert!(it.next().is_none(), "iterator depleted");
- assert!(new_dir.is_file(), "file is untouched");
- Ok(())
- }
- #[test]
- fn racy_directory_creation_with_new_directory_being_deleted_not_enough_retries() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("a").join("new");
- let parent_dir = new_dir.parent().unwrap();
- let mut it = create::Iter::new_with_retries(
- &new_dir,
- Retries {
- to_create_entire_directory: 2,
- on_create_directory_failure: 2,
- ..Default::default()
- },
- );
-
- assert!(
- matches!(it.nth(1), Some(Ok(dir)) if dir == parent_dir),
- "parent dir is created"
- );
- // Someone deletes the new directory
- std::fs::remove_dir(parent_dir)?;
-
- assert!(
- matches!(it.nth(1), Some(Ok(dir)) if dir == parent_dir),
- "parent dir is created"
- );
- // Someone deletes the new directory, again
- std::fs::remove_dir(parent_dir)?;
-
- assert!(
- matches!(it.next(), Some(Err(Permanent{ retries_left, dir, err, .. })) if retries_left.to_create_entire_directory == 0
- && retries_left.on_create_directory_failure == 1
- && err.kind() == NotFound
- && dir == new_dir),
- "we run out of attempts to retry to combat against raciness"
- );
- Ok(())
- }
-
- #[test]
- fn racy_directory_creation_with_new_directory_being_deleted() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let new_dir = dir.path().join("a").join("new");
- let parent_dir = new_dir.parent().unwrap();
- let mut it = create::Iter::new(&new_dir);
-
- assert!(
- matches!(it.next(), Some(Err(Intermediate{dir, kind:k})) if k == NotFound && dir == new_dir),
- "dir is not present, and we go up a level"
- );
- assert!(
- matches!(it.next(), Some(Ok(dir)) if dir == parent_dir),
- "parent dir is created"
- );
- // Someone deletes the new directory
- std::fs::remove_dir(parent_dir)?;
-
- assert!(
- matches!(it.next(), Some(Err(Intermediate{dir, kind:k})) if k == NotFound && dir == new_dir),
- "now when it tries the actual dir its not found"
- );
- assert!(
- matches!(it.next(), Some(Ok(dir)) if dir == parent_dir),
- "parent dir is created as it retries"
- );
- assert!(
- matches!(it.next(), Some(Ok(dir)) if dir == new_dir),
- "target dir is created successfully"
- );
- assert!(it.next().is_none(), "iterator depleted");
- assert!(new_dir.is_dir());
-
- Ok(())
- }
-}
diff --git a/vendor/gix-fs/tests/dir/mod.rs b/vendor/gix-fs/tests/dir/mod.rs
deleted file mode 100644
index 0008e7ee8..000000000
--- a/vendor/gix-fs/tests/dir/mod.rs
+++ /dev/null
@@ -1,2 +0,0 @@
-mod create;
-mod remove;
diff --git a/vendor/gix-fs/tests/dir/remove.rs b/vendor/gix-fs/tests/dir/remove.rs
deleted file mode 100644
index 079cf6834..000000000
--- a/vendor/gix-fs/tests/dir/remove.rs
+++ /dev/null
@@ -1,146 +0,0 @@
-mod empty_upwards_until_boundary {
- use std::{io, path::Path};
-
- use gix_fs::dir::remove;
-
- #[test]
- fn boundary_must_contain_target_dir() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let (target, boundary) = (dir.path().join("a"), dir.path().join("b"));
- std::fs::create_dir(&target)?;
- std::fs::create_dir(&boundary)?;
- assert!(matches!(remove::empty_upward_until_boundary(&target, &boundary),
- Err(err) if err.kind() == io::ErrorKind::InvalidInput));
- assert!(target.is_dir());
- assert!(boundary.is_dir());
- Ok(())
- }
- #[test]
- fn target_directory_non_existing_causes_existing_parents_not_to_be_deleted() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let parent = dir.path().join("a");
- std::fs::create_dir(&parent)?;
- let target = parent.join("not-existing");
- assert_eq!(remove::empty_upward_until_boundary(&target, dir.path())?, target);
- assert!(
- parent.is_dir(),
- "the parent wasn't touched if the target already wasn't present"
- );
- Ok(())
- }
-
- #[test]
- fn target_directory_being_a_file_immediately_fails() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let target = dir.path().join("actually-a-file");
- std::fs::write(&target, [42])?;
- assert!(remove::empty_upward_until_boundary(&target, dir.path()).is_err()); // TODO: check for IsNotADirectory when it becomes stable
- assert!(target.is_file(), "it didn't touch the file");
- assert!(dir.path().is_dir(), "it won't touch the boundary");
- Ok(())
- }
- #[test]
- fn boundary_being_the_target_dir_always_succeeds_and_we_do_nothing() -> crate::Result {
- let dir = tempfile::tempdir()?;
- assert_eq!(remove::empty_upward_until_boundary(dir.path(), dir.path())?, dir.path());
- assert!(dir.path().is_dir(), "it won't touch the boundary");
- Ok(())
- }
- #[test]
- fn a_directory_which_doesnt_exist_to_start_with_is_ok() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let target = dir.path().join("does-not-exist");
- assert_eq!(remove::empty_upward_until_boundary(&target, dir.path())?, target);
- assert!(dir.path().is_dir(), "it won't touch the boundary");
- Ok(())
- }
- #[test]
- fn boundary_directory_doesnt_have_to_exist_either_if_the_target_doesnt() -> crate::Result {
- let boundary = Path::new("/boundary");
- let target = Path::new("/boundary/target");
- assert_eq!(remove::empty_upward_until_boundary(target, boundary)?, target);
- Ok(())
- }
- #[test]
- fn nested_directory_deletion_works() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let nested = dir.path().join("a").join("b").join("to-delete");
- std::fs::create_dir_all(&nested)?;
- assert_eq!(remove::empty_upward_until_boundary(&nested, dir.path())?, nested);
- assert!(!nested.is_dir(), "it actually deleted the nested directory");
- assert!(!nested.parent().unwrap().is_dir(), "parent one was deleted");
- assert!(
- !nested.parent().unwrap().parent().unwrap().is_dir(),
- "parent two was deleted"
- );
- assert!(dir.path().is_dir(), "it won't touch the boundary");
- Ok(())
- }
-}
-
-mod empty_depth_first {
- use std::{
- fs::{create_dir, create_dir_all},
- path::Path,
- };
-
- #[test]
- fn non_empty_anywhere_and_deletion_fails() -> crate::Result {
- let dir = tempfile::TempDir::new()?;
- let touch = |base: &Path, name: &str| create_dir_all(base).and_then(|_| std::fs::write(base.join(name), b""));
-
- let nested_parent = dir.path().join("a");
- touch(&nested_parent, "hello.ext")?;
-
- let tree_parent = dir.path().join("tree");
- touch(&tree_parent.join("a").join("b"), "hello.ext")?;
- create_dir_all(tree_parent.join("one").join("two").join("empty"))?;
-
- assert!(gix_fs::dir::remove::empty_depth_first(nested_parent).is_err());
- Ok(())
- }
-
- #[test]
- fn nested_empty_and_single_empty_delete_successfully() {
- let dir = tempfile::TempDir::new().unwrap();
- let nested_parent = dir.path().join("a");
- let nested = nested_parent.join("b").join("leaf");
- create_dir_all(nested).unwrap();
-
- let single_parent = dir.path().join("single");
- create_dir(&single_parent).unwrap();
-
- let tree_parent = dir.path().join("tree");
- create_dir_all(tree_parent.join("a").join("b")).unwrap();
- create_dir_all(tree_parent.join("one").join("two").join("three")).unwrap();
- create_dir_all(tree_parent.join("c")).unwrap();
- for empty in &[nested_parent, single_parent, tree_parent] {
- gix_fs::dir::remove::empty_depth_first(empty.into()).unwrap();
- }
- }
-}
-
-/// We assume that all checks above also apply to the iterator, so won't repeat them here
-/// Test outside interference only
-mod iter {
- use gix_fs::dir::remove;
-
- #[test]
- fn racy_directory_creation_during_deletion_always_wins_immediately() -> crate::Result {
- let dir = tempfile::tempdir()?;
- let nested = dir.path().join("a").join("b").join("to-delete");
- std::fs::create_dir_all(&nested)?;
-
- let mut it = remove::Iter::new(&nested, dir.path())?;
- assert_eq!(it.next().expect("item")?, nested, "delete leaves directory");
-
- // recreate the deleted directory in racy fashion, causing the next-to-delete directory not to be empty.
- std::fs::create_dir(&nested)?;
- assert!(
- it.next().expect("err item").is_err(),
- "cannot delete non-empty directory" // TODO: check for IsADirectory when it becomes stable
- );
- assert!(it.next().is_none(), "iterator is depleted");
- Ok(())
- }
-}
diff --git a/vendor/gix-fs/tests/fs.rs b/vendor/gix-fs/tests/fs.rs
deleted file mode 100644
index 63b597956..000000000
--- a/vendor/gix-fs/tests/fs.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-type Result<T = ()> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>;
-mod capabilities;
-mod dir;
-mod stack;
diff --git a/vendor/gix-fs/tests/stack/mod.rs b/vendor/gix-fs/tests/stack/mod.rs
deleted file mode 100644
index 3e8cb7ade..000000000
--- a/vendor/gix-fs/tests/stack/mod.rs
+++ /dev/null
@@ -1,145 +0,0 @@
-use std::path::{Path, PathBuf};
-
-use gix_fs::Stack;
-
-#[derive(Debug, Default, Eq, PartialEq)]
-struct Record {
- push_dir: usize,
- dirs: Vec<PathBuf>,
- push: usize,
-}
-
-impl gix_fs::stack::Delegate for Record {
- fn push_directory(&mut self, stack: &Stack) -> std::io::Result<()> {
- self.push_dir += 1;
- self.dirs.push(stack.current().into());
- Ok(())
- }
-
- fn push(&mut self, _is_last_component: bool, _stack: &Stack) -> std::io::Result<()> {
- self.push += 1;
- Ok(())
- }
-
- fn pop_directory(&mut self) {
- self.dirs.pop();
- }
-}
-
-#[test]
-fn delegate_calls_are_consistent() -> crate::Result {
- let root = PathBuf::from(".");
- let mut s = Stack::new(root.clone());
-
- assert_eq!(s.current(), root);
- assert_eq!(s.current_relative(), Path::new(""));
-
- let mut r = Record::default();
- s.make_relative_path_current("a/b".as_ref(), &mut r)?;
- let mut dirs = vec![root.clone(), root.join("a")];
- assert_eq!(
- r,
- Record {
- push_dir: 2,
- dirs: dirs.clone(),
- push: 2,
- }
- );
-
- s.make_relative_path_current("a/b2".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 2,
- dirs: dirs.clone(),
- push: 3,
- }
- );
-
- s.make_relative_path_current("c/d/e".as_ref(), &mut r)?;
- dirs.pop();
- dirs.extend([root.join("c"), root.join("c").join("d")]);
- assert_eq!(
- r,
- Record {
- push_dir: 4,
- dirs: dirs.clone(),
- push: 6,
- }
- );
-
- dirs.push(root.join("c").join("d").join("x"));
- s.make_relative_path_current("c/d/x/z".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 5,
- dirs: dirs.clone(),
- push: 8,
- }
- );
-
- dirs.drain(dirs.len() - 3..).count();
- s.make_relative_path_current("f".as_ref(), &mut r)?;
- assert_eq!(s.current_relative(), Path::new("f"));
- assert_eq!(
- r,
- Record {
- push_dir: 5,
- dirs: dirs.clone(),
- push: 9,
- }
- );
-
- dirs.push(root.join("x"));
- s.make_relative_path_current("x/z".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 6,
- dirs: dirs.clone(),
- push: 11,
- }
- );
-
- dirs.push(root.join("x").join("z"));
- s.make_relative_path_current("x/z/a".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 7,
- dirs: dirs.clone(),
- push: 12,
- }
- );
-
- dirs.push(root.join("x").join("z").join("a"));
- dirs.push(root.join("x").join("z").join("a").join("b"));
- s.make_relative_path_current("x/z/a/b/c".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 9,
- dirs: dirs.clone(),
- push: 14,
- }
- );
-
- dirs.drain(dirs.len() - 2..).count();
- s.make_relative_path_current("x/z".as_ref(), &mut r)?;
- assert_eq!(
- r,
- Record {
- push_dir: 9,
- dirs: dirs.clone(),
- push: 14,
- }
- );
- assert_eq!(
- dirs.last(),
- Some(&PathBuf::from("./x/z")),
- "the stack is state so keeps thinking it's a directory which is consistent. Git does it differently though."
- );
-
- Ok(())
-}