From 9918693037dce8aa4bb6f08741b6812923486c18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 11:26:03 +0200 Subject: Merging upstream version 1.76.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-command/.cargo-checksum.json | 2 +- vendor/gix-command/CHANGELOG.md | 373 -------------------------------- vendor/gix-command/Cargo.toml | 15 +- vendor/gix-command/LICENSE-MIT | 2 - vendor/gix-command/src/lib.rs | 159 +++++++++++++- vendor/gix-command/tests/command.rs | 108 --------- 6 files changed, 163 insertions(+), 496 deletions(-) delete mode 100644 vendor/gix-command/CHANGELOG.md delete mode 100644 vendor/gix-command/tests/command.rs (limited to 'vendor/gix-command') diff --git a/vendor/gix-command/.cargo-checksum.json b/vendor/gix-command/.cargo-checksum.json index 10887293e..879df50e5 100644 --- a/vendor/gix-command/.cargo-checksum.json +++ b/vendor/gix-command/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"b8107f9d62dab5b15c41cbf5805f2b29c35087f4c680fe898876f3afd8ed5096","Cargo.toml":"ede3b6a8e18bd482082cc4cff39f1043b8101099b2f399d8401e27f03412f864","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/lib.rs":"a8149c52abe2f2c2f9883a816ceff553bd67eff1e05aae591df0a12edcbbbbd9","tests/command.rs":"0005efdd3ab1ebe627ee2ba03f079c1f8cc3af98c558bbdf65efe4b0ed458b7b"},"package":"3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7"} \ No newline at end of file +{"files":{"Cargo.toml":"bc3972ecaaf7928228b75f5a86edf62d4f4a54edc7856fa9f98eb3731b10dad5","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"6f610e51b59dfbcbee281f58cc6d963bf716199dc7384dbaa94ccc3a6e343ce6","src/lib.rs":"e3c482134fb81ff2dc2354da0590aa08f37e1412cc439252ba53648573df7ce8"},"package":"b3b54c1d8d63e6ef2adbd9b94d6e49ff168858510b44d3811cdd02dfacc4f0c9"} \ No newline at end of file diff --git a/vendor/gix-command/CHANGELOG.md b/vendor/gix-command/CHANGELOG.md deleted file mode 100644 index 1eb9447f7..000000000 --- a/vendor/gix-command/CHANGELOG.md +++ /dev/null @@ -1,373 +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.2.10 (2023-10-12) - -A maintenance release without user-facing changes. - -### Commit Statistics - - - - - 4 commits contributed to the release over the course of 51 calendar days. - - 51 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - - - -
view details - - * **Uncategorized** - - Prepare changelogs prior to release ([`1347a54`](https://github.com/Byron/gitoxide/commit/1347a54f84599d8f0aa935d6e64b16c2298d25cf)) - - Merge branch 'reset' ([`b842691`](https://github.com/Byron/gitoxide/commit/b8426919a491dc3a7df01ee3f258fc0d8a3a327c)) - - Fix gix-command tests on windows ([`67a0220`](https://github.com/Byron/gitoxide/commit/67a0220dc4c4ff6f79a24771fb175baec22bc6b0)) - - Merge branch 'gix-submodule' ([`363ee77`](https://github.com/Byron/gitoxide/commit/363ee77400805f473c9ad66eadad9214e7ab66f4)) -
- -## 0.2.9 (2023-08-22) - - - -### Chore - - - don't call crate 'WIP' in manifest anymore. - -### Commit Statistics - - - - - 5 commits contributed to the release over the course of 18 calendar days. - - 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 - - - -
view details - - * **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)) - - Don't call crate 'WIP' in manifest anymore. ([`229bd48`](https://github.com/Byron/gitoxide/commit/229bd4899213f749a7cc124aa2b82a1368fba40f)) - - Merge branch 'dev-on-linux' ([`6b4a303`](https://github.com/Byron/gitoxide/commit/6b4a30330fe49fc97daa73f55bf56580cc0597aa)) - - Fix various tests to run properly on linux ([`ef8ccd9`](https://github.com/Byron/gitoxide/commit/ef8ccd9d16143d37155d063747c69cade80f162d)) -
- -## 0.2.8 (2023-07-22) - -A maintenance release without user-facing changes. - -### Commit Statistics - - - - - 5 commits contributed to the release over the course of 1 calendar day. - - 3 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - - - -
view details - - * **Uncategorized** - - Release gix-features v0.32.1, gix-actor v0.24.1, gix-validate v0.7.7, gix-object v0.33.1, gix-path v0.8.4, gix-glob v0.10.1, gix-quote v0.4.6, gix-attributes v0.16.0, gix-command v0.2.8, gix-packetline-blocking v0.16.4, gix-filter v0.2.0, gix-fs v0.4.1, gix-chunk v0.4.4, gix-commitgraph v0.18.1, gix-hashtable v0.2.4, gix-revwalk v0.4.1, gix-traverse v0.30.1, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.5, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.1, gix-sec v0.8.4, gix-prompt v0.5.4, gix-url v0.21.1, gix-credentials v0.17.1, gix-diff v0.33.1, gix-discover v0.22.1, gix-ignore v0.5.1, gix-bitmap v0.2.6, gix-index v0.21.1, gix-mailmap v0.16.1, gix-negotiate v0.5.1, gix-pack v0.40.1, gix-odb v0.50.1, gix-packetline v0.16.4, gix-transport v0.34.1, gix-protocol v0.36.1, gix-revision v0.18.1, gix-refspec v0.14.1, gix-worktree v0.23.0, gix v0.50.0, safety bump 5 crates ([`16295b5`](https://github.com/Byron/gitoxide/commit/16295b58e2581d2e8b8b762816f52baabe871c75)) - - Prepare more changelogs ([`c4cc5f2`](https://github.com/Byron/gitoxide/commit/c4cc5f261d29f712a101033a18293a97a9d4ae85)) - - Release gix-date v0.7.1, gix-hash v0.11.4, gix-trace v0.1.3, gix-features v0.32.0, gix-actor v0.24.0, gix-validate v0.7.7, gix-object v0.33.0, gix-path v0.8.4, gix-glob v0.10.0, gix-quote v0.4.6, gix-attributes v0.15.0, gix-command v0.2.7, gix-packetline-blocking v0.16.3, gix-filter v0.1.0, gix-fs v0.4.0, gix-chunk v0.4.4, gix-commitgraph v0.18.0, gix-hashtable v0.2.4, gix-revwalk v0.4.0, gix-traverse v0.30.0, gix-worktree-stream v0.2.0, gix-archive v0.2.0, gix-config-value v0.12.4, gix-tempfile v7.0.1, gix-utils v0.1.5, gix-lock v7.0.2, gix-ref v0.33.0, gix-sec v0.8.4, gix-prompt v0.5.3, gix-url v0.21.0, gix-credentials v0.17.0, gix-diff v0.33.0, gix-discover v0.22.0, gix-ignore v0.5.0, gix-bitmap v0.2.6, gix-index v0.21.0, gix-mailmap v0.16.0, gix-negotiate v0.5.0, gix-pack v0.40.0, gix-odb v0.50.0, gix-packetline v0.16.4, gix-transport v0.34.0, gix-protocol v0.36.0, gix-revision v0.18.0, gix-refspec v0.14.0, gix-worktree v0.22.0, gix v0.49.1 ([`5cb3589`](https://github.com/Byron/gitoxide/commit/5cb3589b74fc5376e02cbfe151e71344e1c417fe)) - - Update changelogs prior to release ([`2fc66b5`](https://github.com/Byron/gitoxide/commit/2fc66b55097ed494b72d1af939ba5561f71fde97)) - - Update license field following SPDX 2.1 license expression standard ([`9064ea3`](https://github.com/Byron/gitoxide/commit/9064ea31fae4dc59a56bdd3a06c0ddc990ee689e)) -
- -## 0.2.7 (2023-07-19) - - - -### Chore - - - curtail `bstr` features to exactly what's needed. - -### Commit Statistics - - - - - 5 commits contributed to the release over the course of 17 calendar days. - - 26 days passed between releases. - - 1 commit was understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - - - -
view details - - * **Uncategorized** - - Release gix-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)) - - Merge branch 'integrate-filtering' ([`b19a56d`](https://github.com/Byron/gitoxide/commit/b19a56dcfa9bea86332a84aa4e8fad445e7d1724)) - - Curtail `bstr` features to exactly what's needed. ([`7f7db97`](https://github.com/Byron/gitoxide/commit/7f7db9794c23b87c8ea50b7bcf38955c9d977624)) -
- -## 0.2.6 (2023-06-22) - -A maintenance release without user-facing changes. - -### Commit Statistics - - - - - 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 - - - -
view details - - * **Uncategorized** - - Release gix-date v0.6.0, gix-hash v0.11.3, gix-trace v0.1.1, gix-features v0.31.0, gix-actor v0.22.0, gix-path v0.8.2, gix-glob v0.9.0, gix-quote v0.4.5, gix-attributes v0.14.0, gix-chunk v0.4.3, gix-commitgraph v0.17.0, gix-config-value v0.12.2, gix-fs v0.3.0, gix-tempfile v7.0.0, gix-utils v0.1.3, gix-lock v7.0.0, gix-validate v0.7.6, gix-object v0.31.0, gix-ref v0.31.0, gix-sec v0.8.2, gix-config v0.24.0, gix-command v0.2.6, gix-prompt v0.5.2, gix-url v0.20.0, gix-credentials v0.16.0, gix-diff v0.31.0, gix-discover v0.20.0, gix-hashtable v0.2.2, gix-ignore v0.4.0, gix-bitmap v0.2.5, gix-revwalk v0.2.0, gix-traverse v0.28.0, gix-index v0.19.0, gix-mailmap v0.14.0, gix-negotiate v0.3.0, gix-pack v0.38.0, gix-odb v0.48.0, gix-packetline v0.16.3, gix-transport v0.33.0, gix-protocol v0.34.0, gix-revision v0.16.0, gix-refspec v0.12.0, gix-worktree v0.20.0, gix v0.47.0, gitoxide-core v0.29.0, gitoxide v0.27.0, safety bump 30 crates ([`ea9f942`](https://github.com/Byron/gitoxide/commit/ea9f9424e777f10da0e33bb9ffbbefd01c4c5a74)) - - Prepare changelogs prior to release ([`18b0a37`](https://github.com/Byron/gitoxide/commit/18b0a371941aa2d4d62512437d5daa351ba99ffd)) - - Merge branch 'corpus' ([`aa16c8c`](https://github.com/Byron/gitoxide/commit/aa16c8ce91452a3e3063cf1cf0240b6014c4743f)) - - Change MSRV to 1.65 ([`4f635fc`](https://github.com/Byron/gitoxide/commit/4f635fc4429350bae2582d25de86429969d28f30)) -
- -## 0.2.5 (2023-06-06) - -A maintenance release without user-facing changes. - -### Commit Statistics - - - - - 5 commits contributed to the release over the course of 12 calendar days. - - 105 days passed between releases. - - 0 commits were understood as [conventional](https://www.conventionalcommits.org). - - 0 issues like '(#ID)' were seen in commit messages - -### Commit Details - - - -
view details - - * **Uncategorized** - - Release gix-date v0.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 'main' into auto-clippy ([`3ef5c90`](https://github.com/Byron/gitoxide/commit/3ef5c90aebce23385815f1df674c1d28d58b4b0d)) - - Merge branch 'blinxen/main' ([`9375cd7`](https://github.com/Byron/gitoxide/commit/9375cd75b01aa22a0e2eed6305fe45fabfd6c1ac)) - - Include license files in all crates ([`facaaf6`](https://github.com/Byron/gitoxide/commit/facaaf633f01c857dcf2572c6dbe0a92b7105c1c)) -
- -## 0.2.4 (2023-02-20) - -### Bug Fixes - - - note that crates have been renamed from `git-*` to `gix-*`. - This also means that the `git-*` prefixed crates of the `gitoxide` project - are effectively unmaintained. - Use the crates with the `gix-*` prefix instead. - - If you were using `git-repository`, then `gix` is its substitute. - - compatibility with `bstr` v1.3, use `*.as_bytes()` instead of `.as_ref()`. - `as_ref()` relies on a known target type which isn't always present. However, once - there is only one implementation, that's no problem, but when that changes compilation - fails due to ambiguity. - -### Commit Statistics - - - - - 2 commits contributed to the release. - - 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 - - - -
view details - - * **Uncategorized** - - Release gix-date v0.4.3, gix-hash v0.10.3, gix-features v0.26.5, gix-actor v0.17.2, gix-glob v0.5.5, gix-path v0.7.2, gix-quote v0.4.2, gix-attributes v0.8.3, gix-validate v0.7.3, gix-object v0.26.2, gix-ref v0.24.1, gix-config v0.16.2, gix-command v0.2.4, gix-url v0.13.3, gix-credentials v0.9.2, gix-discover v0.13.1, gix-index v0.12.4, gix-mailmap v0.9.3, gix-pack v0.30.3, gix-packetline v0.14.3, gix-transport v0.25.6, gix-protocol v0.26.4, gix-revision v0.10.4, gix-refspec v0.7.3, gix-worktree v0.12.3, gix v0.36.1 ([`9604783`](https://github.com/Byron/gitoxide/commit/96047839a20a657a559376b0b14c65aeab96acbd)) - - Compatibility with `bstr` v1.3, use `*.as_bytes()` instead of `.as_ref()`. ([`135d317`](https://github.com/Byron/gitoxide/commit/135d317065aae87af302beb6c26bb6ca8e30b6aa)) -
- -## 0.2.3 (2023-02-17) - -A maintenance release without user-facing changes. - -### New Features (BREAKING) - - - 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. - -### New Features - - - allow setting more information when preparing commands. - This includes - - - disallowing the usage of a shell - -### Commit Statistics - - - - - 83 commits contributed to the release over the course of 176 calendar days. - - 2 commits were understood as [conventional](https://www.conventionalcommits.org). - - 3 unique issues were worked on: [#450](https://github.com/Byron/gitoxide/issues/450), [#470](https://github.com/Byron/gitoxide/issues/470), [#691](https://github.com/Byron/gitoxide/issues/691) - -### Commit Details - - - -
view details - - * **[#450](https://github.com/Byron/gitoxide/issues/450)** - - Allow programs to communicate errors by default ([`5a2168e`](https://github.com/Byron/gitoxide/commit/5a2168e62f664d463fc8849efecccf7e90b382cd)) - - Fix docs ([`f86364c`](https://github.com/Byron/gitoxide/commit/f86364c4e2d9efd04027978679232946494a4734)) - - Fix CI ([`6565b97`](https://github.com/Byron/gitoxide/commit/6565b97d7d293ae881590960bf3e29f46fdb2cd1)) - - Remove `allow prompt` builder method as typical prompt implementations don't need it ([`0236d75`](https://github.com/Byron/gitoxide/commit/0236d753805003d5a09505fab7da0b5b47392c45)) - - A builder method to allow prompts specifically ([`3be1fc7`](https://github.com/Byron/gitoxide/commit/3be1fc7d97f87893cecbe5d880576ab690bb205f)) - - Only actually use the shell if it appears to be required ([`830ee07`](https://github.com/Byron/gitoxide/commit/830ee07d943725e55a40a546b3a1b7ecefb75c4b)) - - Support for multiple arguments with shell-script support ([`d8e8b54`](https://github.com/Byron/gitoxide/commit/d8e8b541bd776a267aca6dbfb8e7e793e264885b)) - - Squelch errors by default ([`1cb2e96`](https://github.com/Byron/gitoxide/commit/1cb2e967416b0fa5c6d32a0ad0b015b41f81e92c)) - - Add a way to transform a `Prepare` into a `Command` for even more flexibility ([`eeedd2c`](https://github.com/Byron/gitoxide/commit/eeedd2cab3c201109aa5bd986eb38c1f31d5fd20)) - - Set version to 0.1 to avoid surprises like happened with `git-date` ([`1322f72`](https://github.com/Byron/gitoxide/commit/1322f72fd2bd310c1c3c859ee4b49f47cdfaf100)) - - Add remaining docs ([`6a39e62`](https://github.com/Byron/gitoxide/commit/6a39e62bb4aebf9c48daddf007c95b2117b4454d)) - - Basic support for 'sh' based execution ([`8c61b0b`](https://github.com/Byron/gitoxide/commit/8c61b0bded71dff223e24ae68f8cf7fc50195ce9)) - - First sketch of git-command API ([`cd4a608`](https://github.com/Byron/gitoxide/commit/cd4a608f0b8ef3adeb7a7f1979f653b63e77ad4d)) - - Prepare changelog prior to release ([`579e8f1`](https://github.com/Byron/gitoxide/commit/579e8f138963a057d87837301b097fd804424447)) - - First frame of `git-command` crate ([`436632a`](https://github.com/Byron/gitoxide/commit/436632a3822d3671c073cdbbbaf8e569de62bb09)) - * **[#470](https://github.com/Byron/gitoxide/issues/470)** - - Fix dependency declaration ([`9a8369d`](https://github.com/Byron/gitoxide/commit/9a8369db9cd91a4f7447dc2d363bfb1972e5e9b1)) - - Update changelogs prior to release ([`caa7a1b`](https://github.com/Byron/gitoxide/commit/caa7a1bdef74d7d3166a7e38127a59f5ab3cfbdd)) - * **[#691](https://github.com/Byron/gitoxide/issues/691)** - - Set `rust-version` to 1.64 ([`55066ce`](https://github.com/Byron/gitoxide/commit/55066ce5fd71209abb5d84da2998b903504584bb)) - * **Uncategorized** - - Release gix-config v0.16.1, gix-command v0.2.3, gix-prompt v0.3.2, gix-url v0.13.2, gix-credentials v0.9.1, gix-diff v0.26.1, gix-discover v0.13.0, gix-hashtable v0.1.1, gix-bitmap v0.2.1, gix-traverse v0.22.1, gix-index v0.12.3, gix-mailmap v0.9.2, gix-chunk v0.4.1, gix-pack v0.30.2, gix-odb v0.40.2, gix-packetline v0.14.2, gix-transport v0.25.4, gix-protocol v0.26.3, gix-revision v0.10.3, gix-refspec v0.7.2, gix-worktree v0.12.2, gix v0.36.0 ([`41d57b9`](https://github.com/Byron/gitoxide/commit/41d57b98964094fc1528adb09f69ca824229bf25)) - - Release gix-attributes v0.8.2, gix-config-value v0.10.1, gix-tempfile v3.0.2, gix-lock v3.0.2, gix-validate v0.7.2, gix-object v0.26.1, gix-ref v0.24.0, gix-sec v0.6.2, gix-config v0.16.1, gix-command v0.2.3, gix-prompt v0.3.2, gix-url v0.13.2, gix-credentials v0.9.1, gix-diff v0.26.1, gix-discover v0.13.0, gix-hashtable v0.1.1, gix-bitmap v0.2.1, gix-traverse v0.22.1, gix-index v0.12.3, gix-mailmap v0.9.2, gix-chunk v0.4.1, gix-pack v0.30.2, gix-odb v0.40.2, gix-packetline v0.14.2, gix-transport v0.25.4, gix-protocol v0.26.3, gix-revision v0.10.3, gix-refspec v0.7.2, gix-worktree v0.12.2, gix v0.36.0 ([`e313112`](https://github.com/Byron/gitoxide/commit/e31311257bd138b52042dea5fc40c3abab7f269b)) - - Release gix-features v0.26.4, gix-actor v0.17.1, gix-glob v0.5.3, gix-path v0.7.1, gix-quote v0.4.1, gix-attributes v0.8.2, gix-config-value v0.10.1, gix-tempfile v3.0.2, gix-lock v3.0.2, gix-validate v0.7.2, gix-object v0.26.1, gix-ref v0.24.0, gix-sec v0.6.2, gix-config v0.16.1, gix-command v0.2.3, gix-prompt v0.3.2, gix-url v0.13.2, gix-credentials v0.9.1, gix-diff v0.26.1, gix-discover v0.13.0, gix-hashtable v0.1.1, gix-bitmap v0.2.1, gix-traverse v0.22.1, gix-index v0.12.3, gix-mailmap v0.9.2, gix-chunk v0.4.1, gix-pack v0.30.2, gix-odb v0.40.2, gix-packetline v0.14.2, gix-transport v0.25.4, gix-protocol v0.26.3, gix-revision v0.10.3, gix-refspec v0.7.2, gix-worktree v0.12.2, gix v0.36.0 ([`6efd0d3`](https://github.com/Byron/gitoxide/commit/6efd0d31fbeca31ab7319aa2ac97bb31dc4ce055)) - - Release gix-date v0.4.2, gix-hash v0.10.2, gix-features v0.26.4, gix-actor v0.17.1, gix-glob v0.5.3, gix-path v0.7.1, gix-quote v0.4.1, gix-attributes v0.8.2, gix-config-value v0.10.1, gix-tempfile v3.0.2, gix-lock v3.0.2, gix-validate v0.7.2, gix-object v0.26.1, gix-ref v0.24.0, gix-sec v0.6.2, gix-config v0.16.1, gix-command v0.2.3, gix-prompt v0.3.2, gix-url v0.13.2, gix-credentials v0.9.1, gix-diff v0.26.1, gix-discover v0.13.0, gix-hashtable v0.1.1, gix-bitmap v0.2.1, gix-traverse v0.22.1, gix-index v0.12.3, gix-mailmap v0.9.2, gix-chunk v0.4.1, gix-pack v0.30.2, gix-odb v0.40.2, gix-packetline v0.14.2, gix-transport v0.25.4, gix-protocol v0.26.3, gix-revision v0.10.3, gix-refspec v0.7.2, gix-worktree v0.12.2, gix v0.36.0 ([`6ccc88a`](https://github.com/Byron/gitoxide/commit/6ccc88a8e4a56973b1a358cf72dc012ee3c75d56)) - - Merge branch 'rename-crates' into inform-about-gix-rename ([`c9275b9`](https://github.com/Byron/gitoxide/commit/c9275b99ea43949306d93775d9d78c98fb86cfb1)) - - Rename `git-testtools` to `gix-testtools` ([`b65c33d`](https://github.com/Byron/gitoxide/commit/b65c33d256cfed65d11adeff41132e3e58754089)) - - Adjust to renaming of `git-pack` to `gix-pack` ([`1ee81ad`](https://github.com/Byron/gitoxide/commit/1ee81ad310285ee4aa118118a2be3810dbace574)) - - Adjust to renaming of `git-odb` to `gix-odb` ([`476e2ad`](https://github.com/Byron/gitoxide/commit/476e2ad1a64e9e3f0d7c8651d5bcbee36cd78241)) - - Adjust to renaming of `git-index` to `gix-index` ([`86db5e0`](https://github.com/Byron/gitoxide/commit/86db5e09fc58ce66b252dc13b8d7e2c48e4d5062)) - - Adjust to renaming of `git-diff` to `gix-diff` ([`49a163e`](https://github.com/Byron/gitoxide/commit/49a163ec8b18f0e5fcd05a315de16d5d8be7650e)) - - Adjust to renaming of `git-commitgraph` to `gix-commitgraph` ([`f1dd0a3`](https://github.com/Byron/gitoxide/commit/f1dd0a3366e31259af029da73228e8af2f414244)) - - Adjust to renaming of `git-mailmap` to `gix-mailmap` ([`2e28c56`](https://github.com/Byron/gitoxide/commit/2e28c56bb9f70de6f97439818118d3a25859698f)) - - Adjust to renaming of `git-discover` to `gix-discover` ([`53adfe1`](https://github.com/Byron/gitoxide/commit/53adfe1c34e9ea3b27067a97b5e7ac80b351c441)) - - Adjust to renaming of `git-chunk` to `gix-chunk` ([`59194e3`](https://github.com/Byron/gitoxide/commit/59194e3a07853eae0624ebc4907478d1de4f7599)) - - Adjust to renaming of `git-bitmap` to `gix-bitmap` ([`75f2a07`](https://github.com/Byron/gitoxide/commit/75f2a079b17489f62bc43e1f1d932307375c4f9d)) - - Adjust to renaming for `git-protocol` to `gix-protocol` ([`823795a`](https://github.com/Byron/gitoxide/commit/823795addea3810243cab7936cd8ec0137cbc224)) - - Adjust to renaming of `git-refspec` to `gix-refspec` ([`c958802`](https://github.com/Byron/gitoxide/commit/c9588020561577736faa065e7e5b5bb486ca8fe1)) - - Adjust to renaming of `git-revision` to `gix-revision` ([`ee0ee84`](https://github.com/Byron/gitoxide/commit/ee0ee84607c2ffe11ee75f27a31903db68afed02)) - - Adjust to renaming of `git-transport` to `gix-transport` ([`b2ccf71`](https://github.com/Byron/gitoxide/commit/b2ccf716dc4425bb96651d4d58806a3cc2da219e)) - - Adjust to renaming of `git-credentials` to `gix-credentials` ([`6b18abc`](https://github.com/Byron/gitoxide/commit/6b18abcf2856f02ab938d535a65e51ac282bf94a)) - - Adjust to renaming of `git-prompt` to `gix-prompt` ([`6a4654e`](https://github.com/Byron/gitoxide/commit/6a4654e0d10ab773dd219cb4b731c0fc1471c36d)) - - Adjust to renaming of `git-command` to `gix-command` ([`d26b8e0`](https://github.com/Byron/gitoxide/commit/d26b8e046496894ae06b0bbfdba77196976cd975)) - - Rename `git-command` to `gix-command` ([`4d32925`](https://github.com/Byron/gitoxide/commit/4d32925012d88838ef7edbd3882eed1cf76d4600)) - - Adjust to renaming of `git-packetline` to `gix-packetline` ([`5cbd22c`](https://github.com/Byron/gitoxide/commit/5cbd22cf42efb760058561c6c3bbcd4dab8c8be1)) - - Adjust to renaming of `git-worktree` to `gix-worktree` ([`73a1282`](https://github.com/Byron/gitoxide/commit/73a12821b3d9b66ec1714d07dd27eb7a73e3a544)) - - Adjust to renamining of `git-worktree` to `gix-worktree` ([`108bb1a`](https://github.com/Byron/gitoxide/commit/108bb1a634f4828853fb590e9fc125f79441dd38)) - - Adjust to renaming of `git-url` to `gix-url` ([`b50817a`](https://github.com/Byron/gitoxide/commit/b50817aadb143e19f61f64e19b19ec1107d980c6)) - - Adjust to renaming of `git-date` to `gix-date` ([`9a79ff2`](https://github.com/Byron/gitoxide/commit/9a79ff2d5cc74c1efad9f41e21095ae498cce00b)) - - Adjust to renamining of `git-attributes` to `gix-attributes` ([`4a8b3b8`](https://github.com/Byron/gitoxide/commit/4a8b3b812ac26f2a2aee8ce8ca81591273383c84)) - - Adjust to renaminig of `git-quote` to `gix-quote` ([`648025b`](https://github.com/Byron/gitoxide/commit/648025b7ca94411fdd0d90c53e5faede5fde6c8d)) - - Adjust to renaming of `git-config` to `gix-config` ([`3a861c8`](https://github.com/Byron/gitoxide/commit/3a861c8f049f6502d3bcbdac752659aa1aeda46a)) - - Adjust to renaming of `git-ref` to `gix-ref` ([`1f5f695`](https://github.com/Byron/gitoxide/commit/1f5f695407b034377d94b172465ff573562b3fc3)) - - Adjust to renaming of `git-lock` to `gix-lock` ([`2028e78`](https://github.com/Byron/gitoxide/commit/2028e7884ae1821edeec81612f501e88e4722b17)) - - Adjust to renaming of `git-tempfile` to `gix-tempfile` ([`b6cc3eb`](https://github.com/Byron/gitoxide/commit/b6cc3ebb5137084a6327af16a7d9364d8f092cc9)) - - Adjust to renaming of `git-object` to `gix-object` ([`fc86a1e`](https://github.com/Byron/gitoxide/commit/fc86a1e710ad7bf076c25cc6f028ddcf1a5a4311)) - - Adjust to renaming of `git-actor` to `gix-actor` ([`4dc9b44`](https://github.com/Byron/gitoxide/commit/4dc9b44dc52f2486ffa2040585c6897c1bf55df4)) - - Adjust to renaming of `git-validate` to `gix-validate` ([`5e40ad0`](https://github.com/Byron/gitoxide/commit/5e40ad078af3d08cbc2ca81ce755c0ed8a065b4f)) - - Adjust to renaming of `git-hash` to `gix-hash` ([`4a9d025`](https://github.com/Byron/gitoxide/commit/4a9d0257110c3efa61d08c8457c4545b200226d1)) - - Adjust to renaming of `git-features` to `gix-features` ([`e2dd68a`](https://github.com/Byron/gitoxide/commit/e2dd68a417aad229e194ff20dbbfd77668096ec6)) - - Adjust to renaming of `git-glob` to `gix-glob` ([`35b2a3a`](https://github.com/Byron/gitoxide/commit/35b2a3acbc8f2a03f151bc0a3863163844e0ca86)) - - Adjust to renaming of `git-sec` to `gix-sec` ([`eabbb92`](https://github.com/Byron/gitoxide/commit/eabbb923bd5a32fc80fa80f96cfdc2ab7bb2ed17)) - - Adapt to renaming of `git-path` to `gix-path` ([`d3bbcfc`](https://github.com/Byron/gitoxide/commit/d3bbcfccad80fc44ea8e7bf819f23adaca06ba2d)) - - Adjust to rename of `git-config-value` to `gix-config-value` ([`622b3e1`](https://github.com/Byron/gitoxide/commit/622b3e1d0bffa0f8db73697960f9712024fac430)) - - Release git-date v0.4.2, git-hash v0.10.2, git-features v0.26.2, git-actor v0.17.1, git-glob v0.5.3, git-path v0.7.1, git-quote v0.4.1, git-attributes v0.8.2, git-config-value v0.10.1, git-tempfile v3.0.2, git-lock v3.0.2, git-validate v0.7.2, git-object v0.26.1, git-ref v0.24.0, git-sec v0.6.2, git-config v0.16.0, git-command v0.2.3, git-prompt v0.3.2, git-url v0.13.2, git-credentials v0.9.1, git-diff v0.26.1, git-discover v0.13.0, git-hashtable v0.1.1, git-bitmap v0.2.1, git-traverse v0.22.1, git-index v0.12.3, git-mailmap v0.9.2, git-chunk v0.4.1, git-pack v0.30.2, git-odb v0.40.2, git-packetline v0.14.2, git-transport v0.25.4, git-protocol v0.26.3, git-revision v0.10.2, git-refspec v0.7.2, git-worktree v0.12.2, git-repository v0.34.0, safety bump 3 crates ([`c196d20`](https://github.com/Byron/gitoxide/commit/c196d206d57a310b1ce974a1cf0e7e6d6db5c4d6)) - - Prepare changelogs prior to release ([`7c846d2`](https://github.com/Byron/gitoxide/commit/7c846d2102dc767366771925212712ef8cc9bf07)) - - Release git-ref v0.23.0, git-config v0.15.0, git-command v0.2.2, git-diff v0.26.0, git-discover v0.12.0, git-mailmap v0.9.0, git-pack v0.30.0, git-odb v0.40.0, git-transport v0.25.2, git-protocol v0.26.1, git-revision v0.10.0, git-refspec v0.7.0, git-worktree v0.12.0, git-repository v0.32.0 ([`ffb5b6a`](https://github.com/Byron/gitoxide/commit/ffb5b6a21cb415315db6fd5294940c7c6deb4538)) - - Prepare changelogs prior to release ([`4381a03`](https://github.com/Byron/gitoxide/commit/4381a03a34c305f31713cce234c2afbf8ac60f01)) - - Fix warning on windows ([`3569b9f`](https://github.com/Byron/gitoxide/commit/3569b9f4412c98b21c1f7045cc2cf8e84ccd33f0)) - - Release git-features v0.26.0, git-actor v0.16.0, git-attributes v0.8.0, git-object v0.25.0, git-ref v0.22.0, git-config v0.14.0, git-command v0.2.1, git-url v0.13.0, git-credentials v0.9.0, git-diff v0.25.0, git-discover v0.11.0, git-traverse v0.21.0, git-index v0.11.0, git-mailmap v0.8.0, git-pack v0.29.0, git-odb v0.39.0, git-transport v0.25.0, git-protocol v0.26.0, git-revision v0.9.0, git-refspec v0.6.0, git-worktree v0.11.0, git-repository v0.31.0, safety bump 24 crates ([`5ac9fbe`](https://github.com/Byron/gitoxide/commit/5ac9fbe265a5b61c533a2a6b3abfed2bdf7f89ad)) - - Prepare changelogs prior to release ([`30d8ca1`](https://github.com/Byron/gitoxide/commit/30d8ca19284049dcfbb0de2698cafae1d1a16b0c)) - - Make fmt ([`511ed00`](https://github.com/Byron/gitoxide/commit/511ed0000397a5b268530c8f5362e7d25b7c1594)) - - Merge branch 'adjustments-for-cargo' ([`f8c562a`](https://github.com/Byron/gitoxide/commit/f8c562a559e6dc3377583cc7200585dad7c3d481)) - - Allow setting more information when preparing commands. ([`8a67c13`](https://github.com/Byron/gitoxide/commit/8a67c13bf0b9b8646430876768155f62e243ef52)) - - Merge branch 'main' into http-config ([`bcd9654`](https://github.com/Byron/gitoxide/commit/bcd9654e56169799eb706646da6ee1f4ef2021a9)) - - Release git-hash v0.10.0, git-features v0.24.0, git-date v0.3.0, git-actor v0.14.0, git-glob v0.5.0, git-path v0.6.0, git-quote v0.4.0, git-attributes v0.6.0, git-config-value v0.9.0, git-tempfile v3.0.0, git-lock v3.0.0, git-validate v0.7.0, git-object v0.23.0, git-ref v0.20.0, git-sec v0.5.0, git-config v0.12.0, git-command v0.2.0, git-prompt v0.2.0, git-url v0.11.0, git-credentials v0.7.0, git-diff v0.23.0, git-discover v0.9.0, git-bitmap v0.2.0, git-traverse v0.19.0, git-index v0.9.0, git-mailmap v0.6.0, git-chunk v0.4.0, git-pack v0.27.0, git-odb v0.37.0, git-packetline v0.14.0, git-transport v0.23.0, git-protocol v0.24.0, git-revision v0.7.0, git-refspec v0.4.0, git-worktree v0.9.0, git-repository v0.29.0, git-commitgraph v0.11.0, gitoxide-core v0.21.0, gitoxide v0.19.0, safety bump 28 crates ([`b2c301e`](https://github.com/Byron/gitoxide/commit/b2c301ef131ffe1871314e19f387cf10a8d2ac16)) - - Prepare changelogs prior to release ([`e4648f8`](https://github.com/Byron/gitoxide/commit/e4648f827c97e9d13636d1bbdc83dd63436e6e5c)) - - Merge branch 'version2021' ([`0e4462d`](https://github.com/Byron/gitoxide/commit/0e4462df7a5166fe85c23a779462cdca8ee013e8)) - - Upgrade edition to 2021 in most crates. ([`3d8fa8f`](https://github.com/Byron/gitoxide/commit/3d8fa8fef9800b1576beab8a5bc39b821157a5ed)) - - Merge branch 'diff' ([`25a7726`](https://github.com/Byron/gitoxide/commit/25a7726377fbe400ea3c4927d04e9dec99802b7b)) - - Release git-command v0.1.0, git-prompt v0.1.0, git-url v0.9.0, git-credentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-chunk v0.3.2, git-pack v0.23.0, git-odb v0.33.0, git-packetline v0.13.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, git-commitgraph v0.9.0, gitoxide-core v0.18.0, gitoxide v0.16.0 ([`f5c36d8`](https://github.com/Byron/gitoxide/commit/f5c36d85755d1f0f503b77d9a565fad6aecf6728)) - - Release git-hash v0.9.10, git-features v0.22.5, git-date v0.2.0, git-actor v0.12.0, git-glob v0.4.0, git-path v0.5.0, git-quote v0.3.0, git-attributes v0.4.0, git-config-value v0.8.0, git-tempfile v2.0.5, git-validate v0.6.0, git-object v0.21.0, git-ref v0.16.0, git-sec v0.4.0, git-config v0.8.0, git-discover v0.5.0, git-traverse v0.17.0, git-index v0.5.0, git-worktree v0.5.0, git-testtools v0.9.0, git-command v0.1.0, git-prompt v0.1.0, git-url v0.9.0, git-credentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-chunk v0.3.2, git-pack v0.23.0, git-odb v0.33.0, git-packetline v0.13.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, git-commitgraph v0.9.0, gitoxide-core v0.18.0, gitoxide v0.16.0, safety bump 28 crates ([`29a043b`](https://github.com/Byron/gitoxide/commit/29a043be6808a3e9199a9b26bd076fe843afe4f4)) - - Make fmt ([`535e967`](https://github.com/Byron/gitoxide/commit/535e967666c6da657ff1b7eff7c64ab27cafb182)) - - Merge branch 'filter-refs-by-spec' ([`5c05198`](https://github.com/Byron/gitoxide/commit/5c051986bd89590a9287d85d84c713d83dfab83a)) - - Thanks clippy ([`0dc1da5`](https://github.com/Byron/gitoxide/commit/0dc1da5e636b2eecc26fcfa0ecd814af3b78ed29)) - - Release git-command v0.0.0 ([`6c27e94`](https://github.com/Byron/gitoxide/commit/6c27e94c8ed6fb6155704a04d876ab6129b3b413)) -
- -## 0.2.2 (2023-01-09) - -A maintenance release without user-facing changes. - -## 0.2.1 (2022-12-30) - -### New Features - - - allow setting more information when preparing commands. - This includes - - - disallowing the usage of a shell - -## 0.2.0 (2022-11-21) - -### New Features (BREAKING) - - - 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.1.0 (2022-09-20) - -The first usable release. - -## 0.0.0 (2022-08-25) - -Initial release to reserve the name. - diff --git a/vendor/gix-command/Cargo.toml b/vendor/gix-command/Cargo.toml index 4d0a4e186..719941535 100644 --- a/vendor/gix-command/Cargo.toml +++ b/vendor/gix-command/Cargo.toml @@ -13,8 +13,12 @@ edition = "2021" rust-version = "1.65" name = "gix-command" -version = "0.2.10" +version = "0.3.0" authors = ["Sebastian Thiel "] +include = [ + "src/lib.rs", + "LICENSE-*", +] description = "A crate of the gitoxide project handling internal git command execution" license = "MIT OR Apache-2.0" repository = "https://github.com/Byron/gitoxide" @@ -27,4 +31,13 @@ version = "1.5.0" features = ["std"] default-features = false +[dependencies.gix-path] +version = "^0.10.1" + +[dependencies.gix-trace] +version = "^0.1.4" + +[dependencies.shell-words] +version = "1.0" + [dev-dependencies] diff --git a/vendor/gix-command/LICENSE-MIT b/vendor/gix-command/LICENSE-MIT index b58e818f1..97c2fa7d8 100644 --- a/vendor/gix-command/LICENSE-MIT +++ b/vendor/gix-command/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-command/src/lib.rs b/vendor/gix-command/src/lib.rs index 9e662b016..e23275e73 100644 --- a/vendor/gix-command/src/lib.rs +++ b/vendor/gix-command/src/lib.rs @@ -2,12 +2,16 @@ #![deny(rust_2018_idioms, missing_docs)] #![forbid(unsafe_code)] -use std::ffi::OsString; +use std::{ffi::OsString, path::PathBuf}; + +use bstr::BString; /// A structure to keep settings to use when invoking a command via [`spawn()`][Prepare::spawn()], after creating it with [`prepare()`]. pub struct Prepare { /// The command to invoke (either with or without shell depending on `use_shell`. pub command: OsString, + /// Additional information to be passed to the spawned command. + pub context: Option, /// The way standard input is configured. pub stdin: std::process::Stdio, /// The way standard output is configured. @@ -20,6 +24,54 @@ pub struct Prepare { pub env: Vec<(OsString, OsString)>, /// If `true`, we will use `sh` to execute the `command`. pub use_shell: bool, + /// If `true` (default `true` on windows and `false` everywhere else) + /// we will see if it's safe to manually invoke `command` after splitting + /// its arguments as a shell would do. + /// Note that outside of windows, it's generally not advisable as this + /// removes support for literal shell scripts with shell-builtins. + /// + /// This mimics the behaviour we see with `git` on windows, which also + /// won't invoke the shell there at all. + /// + /// Only effective if `use_shell` is `true` as well, as the shell will + /// be used as a fallback if it's not possible to split arguments as + /// the command-line contains 'scripting'. + pub allow_manual_arg_splitting: bool, +} + +/// Additional information that is relevant to spawned processes, which typically receive +/// a wealth of contextual information when spawned from `git`. +/// +/// See [the git source code](https://github.com/git/git/blob/cfb8a6e9a93adbe81efca66e6110c9b4d2e57169/git.c#L191) +/// for details. +#[derive(Debug, Default, Clone)] +pub struct Context { + /// The `.git` directory that contains the repository. + /// + /// If set, it will be used to set the the `GIT_DIR` environment variable. + pub git_dir: Option, + /// Set the `GIT_WORK_TREE` environment variable with the given path. + pub worktree_dir: Option, + /// If `true`, set `GIT_NO_REPLACE_OBJECTS` to `1`, which turns off object replacements, or `0` otherwise. + /// If `None`, the variable won't be set. + pub no_replace_objects: Option, + /// Set the `GIT_NAMESPACE` variable with the given value, effectively namespacing all + /// operations on references. + pub ref_namespace: Option, + /// If `true`, set `GIT_LITERAL_PATHSPECS` to `1`, which makes globs literal and prefixes as well, or `0` otherwise. + /// If `None`, the variable won't be set. + pub literal_pathspecs: Option, + /// If `true`, set `GIT_GLOB_PATHSPECS` to `1`, which lets wildcards not match the `/` character, and equals the `:(glob)` prefix. + /// If `false`, set `GIT_NOGLOB_PATHSPECS` to `1` which lets globs match only themselves. + /// If `None`, the variable won't be set. + pub glob_pathspecs: Option, + /// If `true`, set `GIT_ICASE_PATHSPECS` to `1`, to let patterns match case-insensitively, or `0` otherwise. + /// If `None`, the variable won't be set. + pub icase_pathspecs: Option, + /// If `true`, inherit `stderr` just like it's the default when spawning processes. + /// If `false`, suppress all stderr output. + /// If not `None`, this will override any value set with [`Prepare::stderr()`]. + pub stderr: Option, } mod prepare { @@ -30,11 +82,12 @@ mod prepare { use bstr::ByteSlice; - use crate::Prepare; + use crate::{Context, Prepare}; /// Builder impl Prepare { - /// If called, the command will not be executed directly, but with `sh`. + /// If called, the command will not be executed directly, but with `sh`, but ony if the + /// command passed to [`prepare`](super::prepare()) requires this. /// /// This also allows to pass shell scripts as command, or use commands that contain arguments which are subsequently /// parsed by `sh`. @@ -53,6 +106,23 @@ mod prepare { self } + /// Set additional `ctx` to be used when spawning the process. + /// + /// Note that this is a must for most kind of commands that `git` usually spawns, + /// as at least they need to know the correct `git` repository to function. + pub fn with_context(mut self, ctx: Context) -> Self { + self.context = Some(ctx); + self + } + + /// Use a shell, but try to split arguments by hand if this be safely done without a shell. + /// + /// If that's not the case, use a shell instead. + pub fn with_shell_allow_argument_splitting(mut self) -> Self { + self.allow_manual_arg_splitting = true; + self.with_shell() + } + /// Configure the process to use `stdio` for _stdin. pub fn stdin(mut self, stdio: Stdio) -> Self { self.stdin = stdio; @@ -93,21 +163,47 @@ mod prepare { impl Prepare { /// Spawn the command as configured. pub fn spawn(self) -> std::io::Result { - Command::from(self).spawn() + let mut cmd = Command::from(self); + gix_trace::debug!(cmd = ?cmd); + cmd.spawn() } } impl From for Command { fn from(mut prep: Prepare) -> Command { let mut cmd = if prep.use_shell { - let mut cmd = Command::new(if cfg!(windows) { "sh" } else { "/bin/sh" }); - cmd.arg("-c"); - if !prep.args.is_empty() { - prep.command.push(" \"$@\"") + let split_args = prep + .allow_manual_arg_splitting + .then(|| { + if gix_path::into_bstr(std::borrow::Cow::Borrowed(prep.command.as_ref())) + .find_byteset(b"\\|&;<>()$`\n*?[#~%") + .is_none() + { + prep.command + .to_str() + .and_then(|args| shell_words::split(args).ok().map(Vec::into_iter)) + } else { + None + } + }) + .flatten(); + match split_args { + Some(mut args) => { + let mut cmd = Command::new(args.next().expect("non-empty input")); + cmd.args(args); + cmd + } + None => { + let mut cmd = Command::new(if cfg!(windows) { "sh" } else { "/bin/sh" }); + cmd.arg("-c"); + if !prep.args.is_empty() { + prep.command.push(" \"$@\"") + } + cmd.arg(prep.command); + cmd.arg("--"); + cmd + } } - cmd.arg(prep.command); - cmd.arg("--"); - cmd } else { Command::new(prep.command) }; @@ -116,6 +212,39 @@ mod prepare { .stderr(prep.stderr) .envs(prep.env) .args(prep.args); + if let Some(ctx) = prep.context { + if let Some(git_dir) = ctx.git_dir { + cmd.env("GIT_DIR", &git_dir); + } + if let Some(worktree_dir) = ctx.worktree_dir { + cmd.env("GIT_WORK_TREE", worktree_dir); + } + if let Some(value) = ctx.no_replace_objects { + cmd.env("GIT_NO_REPLACE_OBJECTS", usize::from(value).to_string()); + } + if let Some(namespace) = ctx.ref_namespace { + cmd.env("GIT_NAMESPACE", gix_path::from_bstring(namespace)); + } + if let Some(value) = ctx.literal_pathspecs { + cmd.env("GIT_LITERAL_PATHSPECS", usize::from(value).to_string()); + } + if let Some(value) = ctx.glob_pathspecs { + cmd.env( + if value { + "GIT_GLOB_PATHSPECS" + } else { + "GIT_NOGLOB_PATHSPECS" + }, + "1", + ); + } + if let Some(value) = ctx.icase_pathspecs { + cmd.env("GIT_ICASE_PATHSPECS", usize::from(value).to_string()); + } + if let Some(stderr) = ctx.stderr { + cmd.stderr(if stderr { Stdio::inherit() } else { Stdio::null() }); + } + } cmd } } @@ -128,14 +257,22 @@ mod prepare { /// - `stdin` is null to prevent blocking unexpectedly on consumption of stdin /// - `stdout` is captured for consumption by the caller /// - `stderr` is inherited to allow the command to provide context to the user +/// +/// ### Warning +/// +/// When using this method, be sure that the invoked program doesn't rely on the current working dir and/or +/// environment variables to know its context. If so, call instead [`Prepare::with_context()`] to provide +/// additional information. pub fn prepare(cmd: impl Into) -> Prepare { Prepare { command: cmd.into(), + context: None, stdin: std::process::Stdio::null(), stdout: std::process::Stdio::piped(), stderr: std::process::Stdio::inherit(), args: Vec::new(), env: Vec::new(), use_shell: false, + allow_manual_arg_splitting: cfg!(windows), } } diff --git a/vendor/gix-command/tests/command.rs b/vendor/gix-command/tests/command.rs deleted file mode 100644 index 606066da1..000000000 --- a/vendor/gix-command/tests/command.rs +++ /dev/null @@ -1,108 +0,0 @@ -use gix_testtools::Result; - -mod prepare { - fn quoted(input: &[&str]) -> String { - input.iter().map(|s| format!("\"{s}\"")).collect::>().join(" ") - } - #[test] - fn single_and_multiple_arguments() { - let cmd = std::process::Command::from(gix_command::prepare("ls").arg("first").args(["second", "third"])); - assert_eq!(format!("{cmd:?}"), quoted(&["ls", "first", "second", "third"])); - } -} - -mod spawn { - #[cfg(unix)] - use bstr::ByteSlice; - - #[test] - #[cfg(unix)] - fn environment_variables_are_passed_one_by_one() -> crate::Result { - let out = gix_command::prepare("echo $FIRST $SECOND") - .env("FIRST", "first") - .env("SECOND", "second") - .with_shell() - .spawn()? - .wait_with_output()?; - assert_eq!(out.stdout.as_bstr(), "first second\n"); - Ok(()) - } - - #[test] - #[cfg(unix)] - fn disallow_shell() -> crate::Result { - let out = gix_command::prepare("PATH= echo hi") - .with_shell() - .spawn()? - .wait_with_output()?; - assert_eq!(out.stdout.as_bstr(), "hi\n"); - - let mut cmd: std::process::Command = gix_command::prepare("echo hi").with_shell().without_shell().into(); - assert!( - cmd.env_remove("PATH").spawn().is_err(), - "no command named 'echo hi' exists" - ); - Ok(()) - } - - #[test] - fn direct_command_execution_searches_in_path() -> crate::Result { - assert!(gix_command::prepare(if cfg!(unix) { "ls" } else { "dir.exe" }) - .spawn()? - .wait()? - .success()); - Ok(()) - } - - #[cfg(unix)] - #[test] - fn direct_command_with_absolute_command_path() -> crate::Result { - assert!(gix_command::prepare("/bin/ls").spawn()?.wait()?.success()); - Ok(()) - } - - mod with_shell { - use gix_testtools::bstr::ByteSlice; - - #[test] - fn command_in_path_with_args() -> crate::Result { - assert!(gix_command::prepare(if cfg!(unix) { "ls -l" } else { "dir.exe -a" }) - .with_shell() - .spawn()? - .wait()? - .success()); - Ok(()) - } - - #[test] - fn sh_shell_specific_script_code() -> crate::Result { - assert!(gix_command::prepare(":;:;:").with_shell().spawn()?.wait()?.success()); - Ok(()) - } - - #[test] - fn sh_shell_specific_script_code_with_single_extra_arg() -> crate::Result { - let out = gix_command::prepare("printf") - .with_shell() - .arg("1") - .spawn()? - .wait_with_output()?; - assert!(out.status.success()); - assert_eq!(out.stdout.as_bstr(), "1"); - Ok(()) - } - - #[test] - fn sh_shell_specific_script_code_with_multiple_extra_args() -> crate::Result { - let out = gix_command::prepare("printf") - .with_shell() - .arg("%s") - .arg("arg") - .spawn()? - .wait_with_output()?; - assert!(out.status.success()); - assert_eq!(out.stdout.as_bstr(), "arg"); - Ok(()) - } - } -} -- cgit v1.2.3