From dc0db358abe19481e475e10c32149b53370f1a1c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:57:31 +0200 Subject: Merging upstream version 1.72.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-transport/.cargo-checksum.json | 2 +- vendor/gix-transport/CHANGELOG.md | 52 +++++- vendor/gix-transport/Cargo.toml | 17 +- vendor/gix-transport/LICENSE-APACHE | 191 +++++++++++++++++++++ vendor/gix-transport/LICENSE-MIT | 21 +++ .../src/client/async_io/bufread_ext.rs | 2 +- .../gix-transport/src/client/async_io/request.rs | 2 +- vendor/gix-transport/src/client/async_io/traits.rs | 2 +- .../src/client/blocking_io/bufread_ext.rs | 2 +- .../gix-transport/src/client/blocking_io/file.rs | 3 +- .../src/client/blocking_io/http/curl/remote.rs | 2 +- .../src/client/blocking_io/http/traits.rs | 4 +- .../src/client/blocking_io/request.rs | 2 +- .../gix-transport/src/client/blocking_io/traits.rs | 4 +- vendor/gix-transport/src/client/capabilities.rs | 175 +++++++++++-------- vendor/gix-transport/src/client/traits.rs | 2 +- vendor/gix-transport/src/lib.rs | 2 + 17 files changed, 388 insertions(+), 97 deletions(-) create mode 100644 vendor/gix-transport/LICENSE-APACHE create mode 100644 vendor/gix-transport/LICENSE-MIT (limited to 'vendor/gix-transport') diff --git a/vendor/gix-transport/.cargo-checksum.json b/vendor/gix-transport/.cargo-checksum.json index 57a3abec4..24fcaaab0 100644 --- a/vendor/gix-transport/.cargo-checksum.json +++ b/vendor/gix-transport/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"ef1e774e77d9f2c1c8a5d190ed0c4e762039d2b5cb8a7e9de5a52c4d949b3451","Cargo.toml":"ad7f10f9f001b1df53e63a73e33aae41a81c636dd7f3eb256f3dbbbe8268d8a7","src/client/async_io/bufread_ext.rs":"e41868eaa501affde6736799cc288ade608db127842c47567fb0b41e73087315","src/client/async_io/connect.rs":"d2f64a865612cdf2aefebc8c58c28b0d303e697819ae467b0145d18ab87fd359","src/client/async_io/mod.rs":"dbc880330eea5ab38d2ac7aa8d295352cac1011aa4f6c9d9216ccfb7fa79789d","src/client/async_io/request.rs":"ad260288ef4d118af83b9bb3ce34e0d4b4bdac0dd3e2225463a74b8d7b791708","src/client/async_io/traits.rs":"22f76033eb5c8a26bd26bb7a24b26471b64a446f64e9daa535ab9fcb8d837dfe","src/client/blocking_io/bufread_ext.rs":"a5fcf2e396978ad0579834257e58ce61a444f21d67e601c959cff2dad06bf22a","src/client/blocking_io/connect.rs":"e146594221beae80385b08094a128066a8772127b989bb63e8bb0b5d7dc7f82d","src/client/blocking_io/file.rs":"90e79c15eb76b4a6faab5728f2a76ee5b6970a7f5f12eb3d093d6e78570f3fdf","src/client/blocking_io/http/curl/mod.rs":"4fa0027b0aabdb71676c5267d8dab446ccd81863dd80dc9ac8f43e7710099ca4","src/client/blocking_io/http/curl/remote.rs":"46e7e34f84d52e39b583c8c2b35c8cd08fcadee95ad6e04390edb4b7348798d9","src/client/blocking_io/http/mod.rs":"3a58753707f5ee2d7a59123d3a749bb17864ed70fe6c5b197174bc9b4861e691","src/client/blocking_io/http/redirect.rs":"1f6d57c8a87a9cb4c3699c53f5e05468d99b89d49532c1f805931dcdcff36c0b","src/client/blocking_io/http/reqwest/mod.rs":"08d09aefaddbd0049676bdbe403fca2282c9da4484a6d7cd8e84ec8a46060184","src/client/blocking_io/http/reqwest/remote.rs":"dfcebff86bbf77401e1f22152b570a125dc38c8e983df51e14f8bb1e2459586c","src/client/blocking_io/http/traits.rs":"dce3e07198f0b769d56d4d3b9a359626d3878cfa53f2a8605b37fc5144ef58b0","src/client/blocking_io/mod.rs":"b3b09948dcad91f5e9060875e5096c3d4155e3fdf33af0415b04f9c6246adec2","src/client/blocking_io/request.rs":"4877c53b0940c44f8c1d7ed84a0186451a1ff0f1d8b4274346ef534baf6d7449","src/client/blocking_io/ssh/mod.rs":"a2eb446804b7d377db8a0bae5d74936271dc7cdd71f12629eaf21a0c821453c8","src/client/blocking_io/ssh/program_kind.rs":"e573e45103ac3978da65cb87be3aac476fc40781a953d2c464f754fa79398cee","src/client/blocking_io/ssh/tests.rs":"309e795036635782a005cba1ddf0e8dcf7b1e1fea49429f644996c942cf7ccbe","src/client/blocking_io/traits.rs":"efc43e28a680e941b4443c6d014b4ce8591e6214f8f88565fc6c6dd1d2bbfc43","src/client/capabilities.rs":"dfdefb6fc9f52ad815d5cd065597571e70769563cc79c5fe16a355b9b9a5d56c","src/client/git/async_io.rs":"97b8dccc93bf5a62349aec7dc967acb59212ca66a49347564da50e4fc64864ec","src/client/git/blocking_io.rs":"42e3ee0f597cc31bd87027e21573ccfd4270b835795526f65ef193cff0da077c","src/client/git/mod.rs":"46d990e403f5f825fb0f9332d2ee1a3d8b33209d5a74fe8b473840bcf8e873c4","src/client/mod.rs":"563bb655c93af9dde121a6c8ddb94055aac862da5ac3e9d0420ca5eb21892387","src/client/non_io_types.rs":"ec10e9d7cf6270caf087643484dc4935b014124cf5b914f28eaa476a6869349a","src/client/traits.rs":"8dd06180d15209ba7d878835858c1f9c8e74656faf303d01b8bcaf7a6512d6b4","src/lib.rs":"da212d3a29ecca99861707d7413dee1864220a4ec4f2b204473606db8c3b58ab"},"package":"f01c2bf7b989c679695ef635fc7d9e80072e08101be4b53193c8e8b649900102"} \ No newline at end of file +{"files":{"CHANGELOG.md":"f62eee0a65c00e91dcf1765ad19ae166a17234fa97d21a6c848bd65fa7158df7","Cargo.toml":"97027a5e91451a0eb68225d5a03f123d5fe52c1c446de4d9474c47a7de397d03","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/client/async_io/bufread_ext.rs":"d9ef051c5bd1abd62ab43db6a50b4bdf163e1d50e8b25624e12aaed1bd8ece52","src/client/async_io/connect.rs":"d2f64a865612cdf2aefebc8c58c28b0d303e697819ae467b0145d18ab87fd359","src/client/async_io/mod.rs":"dbc880330eea5ab38d2ac7aa8d295352cac1011aa4f6c9d9216ccfb7fa79789d","src/client/async_io/request.rs":"6844d8804f1b99836994fdc2faa636542336b988b7ab15d118ea1aa24315cd65","src/client/async_io/traits.rs":"f0ec02bce105d138e438daa1397ff92b82230c19171039b12e995eb2011b8f1e","src/client/blocking_io/bufread_ext.rs":"ffb691bac5e4c7e35506f01aaee3560c80de8143e9eb5755cab2a3da545ed113","src/client/blocking_io/connect.rs":"e146594221beae80385b08094a128066a8772127b989bb63e8bb0b5d7dc7f82d","src/client/blocking_io/file.rs":"663e3a4b62c3860068c0c3fbc16adbb0d1535ee028c23d084f68a853a5bb2641","src/client/blocking_io/http/curl/mod.rs":"4fa0027b0aabdb71676c5267d8dab446ccd81863dd80dc9ac8f43e7710099ca4","src/client/blocking_io/http/curl/remote.rs":"957c511ed64d7c3fee886ef7d16f56e04bfd8ac266680f9c88907dd150c1b6da","src/client/blocking_io/http/mod.rs":"3a58753707f5ee2d7a59123d3a749bb17864ed70fe6c5b197174bc9b4861e691","src/client/blocking_io/http/redirect.rs":"1f6d57c8a87a9cb4c3699c53f5e05468d99b89d49532c1f805931dcdcff36c0b","src/client/blocking_io/http/reqwest/mod.rs":"08d09aefaddbd0049676bdbe403fca2282c9da4484a6d7cd8e84ec8a46060184","src/client/blocking_io/http/reqwest/remote.rs":"dfcebff86bbf77401e1f22152b570a125dc38c8e983df51e14f8bb1e2459586c","src/client/blocking_io/http/traits.rs":"520d9789ee9e5cee861a068f8ca0bd5309c853f288a065d3cfb86d8e0145942f","src/client/blocking_io/mod.rs":"b3b09948dcad91f5e9060875e5096c3d4155e3fdf33af0415b04f9c6246adec2","src/client/blocking_io/request.rs":"1602b053538b864557729fa6b3f74aa91020ead2bdcd55c86dd10c13c9168b94","src/client/blocking_io/ssh/mod.rs":"a2eb446804b7d377db8a0bae5d74936271dc7cdd71f12629eaf21a0c821453c8","src/client/blocking_io/ssh/program_kind.rs":"e573e45103ac3978da65cb87be3aac476fc40781a953d2c464f754fa79398cee","src/client/blocking_io/ssh/tests.rs":"309e795036635782a005cba1ddf0e8dcf7b1e1fea49429f644996c942cf7ccbe","src/client/blocking_io/traits.rs":"7e1ef1d6cd6c03f493fe55dd3ba6ad2a5059db16a22b9b75bbda8b055c207813","src/client/capabilities.rs":"fd74e87fd6b405de1613d9f5bec9fd6c0705e1ba1f2d2afdc349586af0190381","src/client/git/async_io.rs":"97b8dccc93bf5a62349aec7dc967acb59212ca66a49347564da50e4fc64864ec","src/client/git/blocking_io.rs":"42e3ee0f597cc31bd87027e21573ccfd4270b835795526f65ef193cff0da077c","src/client/git/mod.rs":"46d990e403f5f825fb0f9332d2ee1a3d8b33209d5a74fe8b473840bcf8e873c4","src/client/mod.rs":"563bb655c93af9dde121a6c8ddb94055aac862da5ac3e9d0420ca5eb21892387","src/client/non_io_types.rs":"ec10e9d7cf6270caf087643484dc4935b014124cf5b914f28eaa476a6869349a","src/client/traits.rs":"5c7b1f9d4b35ae049e81aa7aea09c0b142df023005d876765581b6b267a015d6","src/lib.rs":"c96d2ade712012d7babb19673c2097139036d6290b010828365da743700b65e2"},"package":"64a39ffed9a9078ed700605e064b15d7c6ae50aa65e7faa36ca6919e8081df15"} \ No newline at end of file diff --git a/vendor/gix-transport/CHANGELOG.md b/vendor/gix-transport/CHANGELOG.md index e4c7fdc04..aef40f1f6 100644 --- a/vendor/gix-transport/CHANGELOG.md +++ b/vendor/gix-transport/CHANGELOG.md @@ -5,6 +5,55 @@ 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.32.0 (2023-06-06) + +### Bug Fixes (BREAKING) + + - parse 'handshake' of `file://` based protocol version 0. + This special protocol kicks in when `git` serves `file://` directly + and no version number is specified. Then it doesn't advertise capabilities + at all, but shows 0000 right away. + Make sure we can parse it, and show it by adding `Version::V0` as well. + +### Commit Statistics + + + + - 15 commits contributed to the release over the course of 12 calendar days. + - 40 days passed between releases. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Thanks Clippy + + + +[Clippy](https://github.com/rust-lang/rust-clippy) helped 1 time to make code idiomatic. + +### Commit Details + + + +
view details + + * **Uncategorized** + - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b)) + - Merge branch 'integrate-gix-negotiate' ([`ae845de`](https://github.com/Byron/gitoxide/commit/ae845dea6cee6523c88a23d7a14293589cf8092f)) + - Parse 'handshake' of `file://` based protocol version 0. ([`aa2d064`](https://github.com/Byron/gitoxide/commit/aa2d0643a212a7a619890f3650c7d7005f8f8fd0)) + - Thanks clippy ([`9525ac8`](https://github.com/Byron/gitoxide/commit/9525ac822aa902f5325f17e7b08ffb60b683e0e7)) + - Merge branch 'fix-docs' ([`420553a`](https://github.com/Byron/gitoxide/commit/420553a10d780e0b2dc466cac120989298a5f187)) + - Cleaning up documentation ([`2578e57`](https://github.com/Byron/gitoxide/commit/2578e576bfa365d194a23a1fb0bf09be230873de)) + - Apply -W clippy::cloned-instead-of-copied ([`150463c`](https://github.com/Byron/gitoxide/commit/150463c26f0d2e1c2b5facba731ccba29cf23228)) + - Merge branch 'auto-clippy' ([`dbf8aa1`](https://github.com/Byron/gitoxide/commit/dbf8aa19d19109195d0274928eae4b94f248cd88)) + - Disallow non-inlined format args and make respective fixes ([`bd101f2`](https://github.com/Byron/gitoxide/commit/bd101f2f3f50d61fecfd6fab4a28a0af744a2bcb)) + - Autofix map-or-unwrap clippy lint (and manual fix what was left) ([`2087032`](https://github.com/Byron/gitoxide/commit/2087032b5956dcd82bce6ac57e530e8724b57f17)) + - Release gix-packetline v0.16.1 ([`d70ce9f`](https://github.com/Byron/gitoxide/commit/d70ce9f822541fdaebb2eb1815929676e6af8648)) + - 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 custom clippy settings ([`b057500`](https://github.com/Byron/gitoxide/commit/b057500dd3e6b75be3ebcd258cda0b946bedd9e1)) + - Include license files in all crates ([`facaaf6`](https://github.com/Byron/gitoxide/commit/facaaf633f01c857dcf2572c6dbe0a92b7105c1c)) +
+ ## 0.31.0 (2023-04-27) A maintenance release without user-facing changes. @@ -13,7 +62,7 @@ A maintenance release without user-facing changes. - - 2 commits contributed to the release. + - 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 @@ -24,6 +73,7 @@ A maintenance release without user-facing changes.
view details * **Uncategorized** + - Release gix-path v0.8.0, gix-glob v0.7.0, gix-attributes v0.12.0, gix-config-value v0.12.0, gix-ref v0.29.0, gix-sec v0.8.0, gix-config v0.22.0, gix-prompt v0.5.0, gix-url v0.18.0, gix-credentials v0.14.0, gix-discover v0.18.0, gix-ignore v0.2.0, gix-pack v0.35.0, gix-odb v0.45.0, gix-transport v0.31.0, gix-protocol v0.32.0, gix-refspec v0.10.1, gix-worktree v0.17.0, gix v0.44.1 ([`7ebc9f7`](https://github.com/Byron/gitoxide/commit/7ebc9f734ec4371dd27daa568c0244185bb49eb5)) - Prepare changelogs prior to release ([`0135158`](https://github.com/Byron/gitoxide/commit/013515897215400539bfd53c25548bd054186ba6)) - 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))
diff --git a/vendor/gix-transport/Cargo.toml b/vendor/gix-transport/Cargo.toml index 4381e3b96..d882d2891 100644 --- a/vendor/gix-transport/Cargo.toml +++ b/vendor/gix-transport/Cargo.toml @@ -13,10 +13,11 @@ edition = "2021" rust-version = "1.64" name = "gix-transport" -version = "0.31.0" +version = "0.32.0" authors = ["Sebastian Thiel "] include = [ "src/**/*", + "LICENSE-*", "CHANGELOG.md", ] description = "A WIP crate of the gitoxide project dedicated to implementing the git transport layer" @@ -95,26 +96,26 @@ version = "1.12.0" optional = true [dependencies.gix-command] -version = "^0.2.4" +version = "^0.2.5" [dependencies.gix-credentials] -version = "^0.14.0" +version = "^0.15.0" optional = true [dependencies.gix-features] -version = "^0.29.0" +version = "^0.30.0" [dependencies.gix-packetline] -version = "^0.16.0" +version = "^0.16.2" [dependencies.gix-quote] -version = "^0.4.3" +version = "^0.4.4" [dependencies.gix-sec] -version = "^0.8.0" +version = "^0.8.1" [dependencies.gix-url] -version = "^0.18.0" +version = "^0.19.0" [dependencies.pin-project-lite] version = "0.2.6" diff --git a/vendor/gix-transport/LICENSE-APACHE b/vendor/gix-transport/LICENSE-APACHE new file mode 100644 index 000000000..a51f59a06 --- /dev/null +++ b/vendor/gix-transport/LICENSE-APACHE @@ -0,0 +1,191 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + Copyright 2018-2021 Sebastian Thiel, and [contributors](https://github.com/byron/gitoxide/contributors) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/gix-transport/LICENSE-MIT b/vendor/gix-transport/LICENSE-MIT new file mode 100644 index 000000000..b58e818f1 --- /dev/null +++ b/vendor/gix-transport/LICENSE-MIT @@ -0,0 +1,21 @@ +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 +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/gix-transport/src/client/async_io/bufread_ext.rs b/vendor/gix-transport/src/client/async_io/bufread_ext.rs index 2b4362fc9..f3eb2a67a 100644 --- a/vendor/gix-transport/src/client/async_io/bufread_ext.rs +++ b/vendor/gix-transport/src/client/async_io/bufread_ext.rs @@ -125,7 +125,7 @@ impl<'a, T: AsyncRead + Unpin> ExtendedBufRead for gix_packetline::read::WithSid } fn reset(&mut self, version: Protocol) { match version { - Protocol::V1 => self.reset_with(&[gix_packetline::PacketLineRef::Flush]), + Protocol::V0 | Protocol::V1 => self.reset_with(&[gix_packetline::PacketLineRef::Flush]), Protocol::V2 => self.reset_with(&[ gix_packetline::PacketLineRef::Delimiter, gix_packetline::PacketLineRef::Flush, diff --git a/vendor/gix-transport/src/client/async_io/request.rs b/vendor/gix-transport/src/client/async_io/request.rs index 1121db356..94cf9bc65 100644 --- a/vendor/gix-transport/src/client/async_io/request.rs +++ b/vendor/gix-transport/src/client/async_io/request.rs @@ -87,7 +87,7 @@ impl<'a> RequestWriter<'a> { Ok(self.reader) } - /// Dissolve this instance into its write and read handles without any message-writing side-effect as in [RequestWriter::into_read()]. + /// Dissolve this instance into its write and read handles without any message-writing side-effect as in [`RequestWriter::into_read()`]. /// /// Furthermore, the writer will not encode everything it writes as packetlines, but write everything verbatim into the /// underlying channel. diff --git a/vendor/gix-transport/src/client/async_io/traits.rs b/vendor/gix-transport/src/client/async_io/traits.rs index ea73f5e09..db296c872 100644 --- a/vendor/gix-transport/src/client/async_io/traits.rs +++ b/vendor/gix-transport/src/client/async_io/traits.rs @@ -91,7 +91,7 @@ impl TransportV2Ext for T { arguments: Option + 'a>, ) -> Result, Error> { let mut writer = self.request(WriteMode::OneLfTerminatedLinePerWriteCall, MessageKind::Flush)?; - writer.write_all(format!("command={}", command).as_bytes()).await?; + writer.write_all(format!("command={command}").as_bytes()).await?; for (name, value) in capabilities { match value { Some(value) => { diff --git a/vendor/gix-transport/src/client/blocking_io/bufread_ext.rs b/vendor/gix-transport/src/client/blocking_io/bufread_ext.rs index 3513a7fd5..c84d26ecc 100644 --- a/vendor/gix-transport/src/client/blocking_io/bufread_ext.rs +++ b/vendor/gix-transport/src/client/blocking_io/bufread_ext.rs @@ -113,7 +113,7 @@ impl<'a, T: io::Read> ExtendedBufRead for gix_packetline::read::WithSidebands<'a } fn reset(&mut self, version: Protocol) { match version { - Protocol::V1 => self.reset_with(&[gix_packetline::PacketLineRef::Flush]), + Protocol::V0 | Protocol::V1 => self.reset_with(&[gix_packetline::PacketLineRef::Flush]), Protocol::V2 => self.reset_with(&[ gix_packetline::PacketLineRef::Delimiter, gix_packetline::PacketLineRef::Flush, diff --git a/vendor/gix-transport/src/client/blocking_io/file.rs b/vendor/gix-transport/src/client/blocking_io/file.rs index d60b70c6e..599f56c23 100644 --- a/vendor/gix-transport/src/client/blocking_io/file.rs +++ b/vendor/gix-transport/src/client/blocking_io/file.rs @@ -151,8 +151,7 @@ fn supervise_stderr( self.recv .recv_timeout(std::time::Duration::from_millis(5)) .ok() - .map(Err) - .unwrap_or(Ok(n)) + .map_or(Ok(n), Err) } Err(err) => Err(self.recv.recv().ok().unwrap_or(err)), }, diff --git a/vendor/gix-transport/src/client/blocking_io/http/curl/remote.rs b/vendor/gix-transport/src/client/blocking_io/http/curl/remote.rs index 8f5867698..3b435423d 100644 --- a/vendor/gix-transport/src/client/blocking_io/http/curl/remote.rs +++ b/vendor/gix-transport/src/client/blocking_io/http/curl/remote.rs @@ -322,7 +322,7 @@ pub fn new() -> ( handler.receive_body.take(); match (handler.send_header.take(), handler.send_data.take()) { (Some(header), mut data) => { - if let Err(TrySendError::Disconnected(err)) | Err(TrySendError::Full(err)) = + if let Err(TrySendError::Disconnected(err) | TrySendError::Full(err)) = header.channel.try_send(err) { if let Some(body) = data.take() { diff --git a/vendor/gix-transport/src/client/blocking_io/http/traits.rs b/vendor/gix-transport/src/client/blocking_io/http/traits.rs index 52176fecc..44aaee459 100644 --- a/vendor/gix-transport/src/client/blocking_io/http/traits.rs +++ b/vendor/gix-transport/src/client/blocking_io/http/traits.rs @@ -35,7 +35,7 @@ impl crate::IsSpuriousError for Error { } } -/// The return value of [Http::get()]. +/// The return value of [`Http::get()`]. pub struct GetResponse { /// The response headers. pub headers: H, @@ -43,7 +43,7 @@ pub struct GetResponse { pub body: B, } -/// The return value of [Http::post()]. +/// The return value of [`Http::post()`]. pub struct PostResponse { /// The body to post to the server as part of the request. /// diff --git a/vendor/gix-transport/src/client/blocking_io/request.rs b/vendor/gix-transport/src/client/blocking_io/request.rs index ae818eff3..32ecf432a 100644 --- a/vendor/gix-transport/src/client/blocking_io/request.rs +++ b/vendor/gix-transport/src/client/blocking_io/request.rs @@ -63,7 +63,7 @@ impl<'a> RequestWriter<'a> { Ok(self.reader) } - /// Dissolve this instance into its write and read handles without any message-writing side-effect as in [RequestWriter::into_read()]. + /// Dissolve this instance into its write and read handles without any message-writing side-effect as in [`RequestWriter::into_read()`]. /// /// Furthermore, the writer will not encode everything it writes as packetlines, but write everything verbatim into the /// underlying channel. diff --git a/vendor/gix-transport/src/client/blocking_io/traits.rs b/vendor/gix-transport/src/client/blocking_io/traits.rs index 7b2eaebbe..20aedfc51 100644 --- a/vendor/gix-transport/src/client/blocking_io/traits.rs +++ b/vendor/gix-transport/src/client/blocking_io/traits.rs @@ -31,8 +31,8 @@ pub trait Transport: TransportWithoutIO { /// Returns the service capabilities according according to the actual [Protocol] it supports, /// and possibly a list of refs to be obtained. /// This means that asking for an unsupported protocol might result in a protocol downgrade to the given one - /// if [TransportWithoutIO::supported_protocol_versions()] includes it. - /// Exhaust the returned [BufReader][SetServiceResponse::refs] for a list of references in case of protocol V1 + /// if [`TransportWithoutIO::supported_protocol_versions()`] includes it. + /// Exhaust the returned [`BufReader`][SetServiceResponse::refs] for a list of references in case of protocol V1 /// before making another request. fn handshake<'a>( &mut self, diff --git a/vendor/gix-transport/src/client/capabilities.rs b/vendor/gix-transport/src/client/capabilities.rs index 05185edae..29b5504ba 100644 --- a/vendor/gix-transport/src/client/capabilities.rs +++ b/vendor/gix-transport/src/client/capabilities.rs @@ -23,13 +23,29 @@ pub enum Error { } /// A structure to represent multiple [capabilities][Capability] or features supported by the server. -#[derive(Debug, Clone, Default)] +/// +/// ### Deviation +/// +/// As a *shortcoming*, we are unable to parse `V1` as emitted from `git-upload-pack` without a `git-daemon` or server, +/// as it will not emit any capabilities for some reason. Only `V2` and `V0` work in that context. +#[derive(Debug, Clone)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct Capabilities { data: BString, value_sep: u8, } +/// This implementation yields exactly those minimal capabilities that are required for `gix` to work, nothing more and nothing less. +/// +/// This is a bit of a hack just get tests with Protocol V0 to work, which is a good way to enforce stateful transports. +/// Of course, V1 would also do that but when calling `git-upload-pack` directly, it advertises so badly that this is easier to implement. +impl Default for Capabilities { + fn default() -> Self { + Capabilities::from_lines("version 2\nmulti_ack_detailed\nside-band-64k\n".into()) + .expect("valid format, known at compile time") + } +} + /// The name of a single capability. pub struct Capability<'a>(&'a BStr); @@ -185,44 +201,50 @@ pub mod recv { // format looks like, thus there is no binary blob that could ever look like an ERR line by accident. rd.fail_on_err_lines(true); - let line = rd - .peek_line() - .ok_or(client::Error::ExpectedLine("capabilities or version"))???; - let line = line.as_text().ok_or(client::Error::ExpectedLine("text"))?; - - let version = Capabilities::extract_protocol(line)?; - match version { - Protocol::V1 => { - let (capabilities, delimiter_position) = Capabilities::from_bytes(line.0)?; - rd.peek_buffer_replace_and_truncate(delimiter_position, b'\n'); - Ok(Outcome { - capabilities, - refs: Some(Box::new(rd.as_read())), - protocol: Protocol::V1, - }) - } - Protocol::V2 => Ok(Outcome { - capabilities: { - let mut rd = rd.as_read(); - let mut buf = Vec::new(); - while let Some(line) = rd.read_data_line() { - let line = line??; - match line.as_bstr() { - Some(line) => { - buf.push_str(line); - if buf.last() != Some(&b'\n') { - buf.push(b'\n'); - } - } - None => break, + Ok(match rd.peek_line() { + Some(line) => { + let line = line??.as_text().ok_or(client::Error::ExpectedLine("text"))?; + let version = Capabilities::extract_protocol(line)?; + match version { + Protocol::V0 => unreachable!("already handled in `None` case"), + Protocol::V1 => { + let (capabilities, delimiter_position) = Capabilities::from_bytes(line.0)?; + rd.peek_buffer_replace_and_truncate(delimiter_position, b'\n'); + Outcome { + capabilities, + refs: Some(Box::new(rd.as_read())), + protocol: Protocol::V1, } } - Capabilities::from_lines(buf.into())? - }, - refs: None, - protocol: Protocol::V2, - }), - } + Protocol::V2 => Outcome { + capabilities: { + let mut rd = rd.as_read(); + let mut buf = Vec::new(); + while let Some(line) = rd.read_data_line() { + let line = line??; + match line.as_bstr() { + Some(line) => { + buf.push_str(line); + if buf.last() != Some(&b'\n') { + buf.push(b'\n'); + } + } + None => break, + } + } + Capabilities::from_lines(buf.into())? + }, + refs: None, + protocol: Protocol::V2, + }, + } + } + None => Outcome { + capabilities: Capabilities::default(), + refs: Some(Box::new(rd.as_read())), + protocol: Protocol::V0, + }, + }) } } } @@ -263,45 +285,50 @@ pub mod recv { // format looks like, thus there is no binary blob that could ever look like an ERR line by accident. rd.fail_on_err_lines(true); - let line = rd - .peek_line() - .await - .ok_or(client::Error::ExpectedLine("capabilities or version"))???; - let line = line.as_text().ok_or(client::Error::ExpectedLine("text"))?; - - let version = Capabilities::extract_protocol(line)?; - match version { - Protocol::V1 => { - let (capabilities, delimiter_position) = Capabilities::from_bytes(line.0)?; - rd.peek_buffer_replace_and_truncate(delimiter_position, b'\n'); - Ok(Outcome { - capabilities, - refs: Some(Box::new(rd.as_read())), - protocol: Protocol::V1, - }) - } - Protocol::V2 => Ok(Outcome { - capabilities: { - let mut rd = rd.as_read(); - let mut buf = Vec::new(); - while let Some(line) = rd.read_data_line().await { - let line = line??; - match line.as_bstr() { - Some(line) => { - buf.push_str(line); - if buf.last() != Some(&b'\n') { - buf.push(b'\n'); - } - } - None => break, + Ok(match rd.peek_line().await { + Some(line) => { + let line = line??.as_text().ok_or(client::Error::ExpectedLine("text"))?; + let version = Capabilities::extract_protocol(line)?; + match version { + Protocol::V0 => unreachable!("already handled in `None` case"), + Protocol::V1 => { + let (capabilities, delimiter_position) = Capabilities::from_bytes(line.0)?; + rd.peek_buffer_replace_and_truncate(delimiter_position, b'\n'); + Outcome { + capabilities, + refs: Some(Box::new(rd.as_read())), + protocol: Protocol::V1, } } - Capabilities::from_lines(buf.into())? - }, - refs: None, - protocol: Protocol::V2, - }), - } + Protocol::V2 => Outcome { + capabilities: { + let mut rd = rd.as_read(); + let mut buf = Vec::new(); + while let Some(line) = rd.read_data_line().await { + let line = line??; + match line.as_bstr() { + Some(line) => { + buf.push_str(line); + if buf.last() != Some(&b'\n') { + buf.push(b'\n'); + } + } + None => break, + } + } + Capabilities::from_lines(buf.into())? + }, + refs: None, + protocol: Protocol::V2, + }, + } + } + None => Outcome { + capabilities: Capabilities::default(), + refs: Some(Box::new(rd.as_read())), + protocol: Protocol::V0, + }, + }) } } } diff --git a/vendor/gix-transport/src/client/traits.rs b/vendor/gix-transport/src/client/traits.rs index 408935391..613d62b1a 100644 --- a/vendor/gix-transport/src/client/traits.rs +++ b/vendor/gix-transport/src/client/traits.rs @@ -13,7 +13,7 @@ use crate::{client::Error, Protocol}; /// This trait represents all transport related functions that don't require any input/output to be done which helps /// implementation to share more code across blocking and async programs. pub trait TransportWithoutIO { - /// If the handshake or subsequent reads failed with [std::io::ErrorKind::PermissionDenied], use this method to + /// If the handshake or subsequent reads failed with [`std::io::ErrorKind::PermissionDenied`], use this method to /// inform the transport layer about the identity to use for subsequent calls. /// If authentication continues to fail even with an identity set, consider communicating this to the provider /// of the identity in order to mark it as invalid. Otherwise the user might have difficulty updating obsolete diff --git a/vendor/gix-transport/src/lib.rs b/vendor/gix-transport/src/lib.rs index 96e03a0e8..a098e635a 100644 --- a/vendor/gix-transport/src/lib.rs +++ b/vendor/gix-transport/src/lib.rs @@ -23,6 +23,8 @@ pub use gix_packetline as packetline; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[allow(missing_docs)] pub enum Protocol { + /// Version 0 is like V1, but doesn't show capabilities at all, at least when hosted without `git-daemon`. + V0 = 0, /// Version 1 was the first one conceived, is stateful, and our implementation was seen to cause deadlocks. Prefer V2 V1 = 1, /// A command-based and stateless protocol with clear semantics, and the one to use assuming the server isn't very old. -- cgit v1.2.3