diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/gix-protocol | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-protocol')
-rw-r--r-- | vendor/gix-protocol/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/gix-protocol/CHANGELOG.md | 127 | ||||
-rw-r--r-- | vendor/gix-protocol/Cargo.toml | 13 | ||||
-rw-r--r-- | vendor/gix-protocol/LICENSE-APACHE | 191 | ||||
-rw-r--r-- | vendor/gix-protocol/LICENSE-MIT | 21 | ||||
-rw-r--r-- | vendor/gix-protocol/src/command/mod.rs | 6 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/arguments/async_io.rs | 2 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/arguments/blocking_io.rs | 2 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/arguments/mod.rs | 36 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/delegate.rs | 4 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/response/async_io.rs | 18 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/response/blocking_io.rs | 18 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/response/mod.rs | 2 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch/tests.rs | 28 | ||||
-rw-r--r-- | vendor/gix-protocol/src/fetch_fn.rs | 7 | ||||
-rw-r--r-- | vendor/gix-protocol/src/handshake/function.rs | 10 | ||||
-rw-r--r-- | vendor/gix-protocol/src/handshake/refs/shared.rs | 4 | ||||
-rw-r--r-- | vendor/gix-protocol/src/ls_refs.rs | 4 |
18 files changed, 457 insertions, 38 deletions
diff --git a/vendor/gix-protocol/.cargo-checksum.json b/vendor/gix-protocol/.cargo-checksum.json index d60dfbf53..bbbd8dc97 100644 --- a/vendor/gix-protocol/.cargo-checksum.json +++ b/vendor/gix-protocol/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"b851b021ae98c001d903539760ee8d2b4f0ab3c9c95aa202be0004fbc6b48a63","Cargo.toml":"2796fb464f9896fdea4ebc70ed1283110ad298ffc82cf7fc57ed69171a50a0d1","src/command/mod.rs":"ec473fea3cdc0d956053005bc381a8793419c593a0b5dd91f6e25305d4ba302c","src/command/tests.rs":"42f5c98a4a8cf1f58c4c97c0f6c61ecf5e6f8380032a8452e8dfd8f093e7a975","src/fetch/arguments/async_io.rs":"cdea0d5a8e627ce7658b51425d0a7714b33db77e7b6214bb5186419193155eed","src/fetch/arguments/blocking_io.rs":"310b75ff3d7faae68ce9c4933a125ad7fc31365abb41e8c6df19c242f8137147","src/fetch/arguments/mod.rs":"f802140b51ee9fe641301e0aece3c68dea5c7a47a108fe54875a35fac56532e0","src/fetch/delegate.rs":"ac7946544846b2c25507a3b8b6c1ee687e99cfc04b1a87d17f444494fd6042d4","src/fetch/error.rs":"63d305d921765056e179a5c19cfe1075319eaaa661877f4cefdc4dc247f3bb44","src/fetch/handshake.rs":"374a0b8394a362cd7fab30aaed2a9fa5a1f047c590da4ee7cfd9c432adc4755a","src/fetch/mod.rs":"94db03392ab0e62d5c33fc02dc6889b8d65c304637d7a9d9b27104f81424c460","src/fetch/response/async_io.rs":"b78aa578466e24e3909937fef37d70f2f5b1717bd19a693113008330793aece0","src/fetch/response/blocking_io.rs":"a2a613b1f4e709210999c94cdc8173111a67932aeb334b991e2ac6b69c5c6325","src/fetch/response/mod.rs":"4f62e89b52c92dd6f1a0649bb228909bf3e443c24dab71abd5cd4e5ad187151a","src/fetch/tests.rs":"13d198035baeacc4586eac1f2b0f22c08b21e496591388309321411bd0a4fba2","src/fetch_fn.rs":"4ca375483f785fd8dc508cabdfcc7a12debb894489a9be1ed89b16b5b4e36c72","src/handshake/function.rs":"6656bb5e87a255c0c043df4a6aa3b92b6eb2d39ec71ab4738c06cb1ad2e7fad4","src/handshake/mod.rs":"49a018f60620ccb7e198bebdef8026996c52aa9374fe5dfd6306605bf6e0a13a","src/handshake/refs/async_io.rs":"1f8143928517f5dcdbeb01b4f98774cf17afe6e37db75558752599ba7b88fd20","src/handshake/refs/blocking_io.rs":"9475538f6b90e46174438a08f89b0cc5ba938644ae409d5c32a5d9fd3e023862","src/handshake/refs/mod.rs":"2bd46c247a6b61095942992a7f036a6c0ba235aa11bab6bece92995dc31f48f6","src/handshake/refs/shared.rs":"f00a08215aa1e64ca434e7b07db20ee56ba2dbf29535e9cb0cd303c3a5a93cbf","src/handshake/refs/tests.rs":"9e7707faafb08d3e2cfb83efe7ee1bee52504ec9ee633eb168732bc18d2936ce","src/lib.rs":"37d70654d2b4bca30f53681b62888bd0b69cc143ee3e5239089842065f1c0b52","src/ls_refs.rs":"880d44ff5c874f46d7c0db4761582451faf6783d78e47a5c6521b8542a221504","src/remote_progress.rs":"cbcb30386c67c86b42f10af863edb72fdc920367aa320bcaf2c54190bd464f43","src/util.rs":"d83861fd81167f09ba0e93278703f827b201299e1991382f6274b6ba8abce6cd"},"package":"877e49417f1730f4dbc2f7d9a2ab0f8b2f49ef08f97270691403ecde3d961e3a"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"e1b8982036c7fc04fce72d2a6657463d075be974d129442547ddb0f4ce7032bb","Cargo.toml":"e1eb4bac30258a140f1093eb1f7a9eed667f9e701608c3257a8e4fe1a216f570","LICENSE-APACHE":"cb4780590812826851ba250f90bed0ed19506ec98f6865a0e2e20bbf62391ff9","LICENSE-MIT":"49df47913ab2beafe8dc45607877ae64198bf0eee64aaad3e82ed9e4d27424e8","src/command/mod.rs":"692abd0c6bef256a68047740fdda77cf27719e76cda879fb43b4b709c3494b14","src/command/tests.rs":"42f5c98a4a8cf1f58c4c97c0f6c61ecf5e6f8380032a8452e8dfd8f093e7a975","src/fetch/arguments/async_io.rs":"5cc55867527012cd27fec718d06d468c075f3f5e9569e389b5d8fbcd9814ca5c","src/fetch/arguments/blocking_io.rs":"913e1071bc589746fd17e42553b6e93bdc7187d36f87d579e1851e44569f77e4","src/fetch/arguments/mod.rs":"5deff5aa39249ed140d30c34c65c77758b122f29341fe451ae722123864aebf3","src/fetch/delegate.rs":"4597719ff3597a934b98b318ab2f8079985aae7ffd04c426c089c7bb6c921e52","src/fetch/error.rs":"63d305d921765056e179a5c19cfe1075319eaaa661877f4cefdc4dc247f3bb44","src/fetch/handshake.rs":"374a0b8394a362cd7fab30aaed2a9fa5a1f047c590da4ee7cfd9c432adc4755a","src/fetch/mod.rs":"94db03392ab0e62d5c33fc02dc6889b8d65c304637d7a9d9b27104f81424c460","src/fetch/response/async_io.rs":"3164a586423029c80bb40e6c9932df068a71b2cdbc0d567d1d463599771b6418","src/fetch/response/blocking_io.rs":"a74308b8f9221ce44898ed4f1d5d6b86ef9cfac80ca1529a2001414e848ca0f2","src/fetch/response/mod.rs":"7fcaac06b56309d0e2eb99be2cebbb755599b95e14c6b8de46c1e8a5a38b1e91","src/fetch/tests.rs":"5c74672d00f254c965b1bcbe7167b8cf024f72e86a9d6c14d57f1ceea394ad6a","src/fetch_fn.rs":"9baa02339dc9d38109a566665cb67d95db36c52a1ef029a0807846f459a0928d","src/handshake/function.rs":"d53c48b8ccd45c219f149b572b4cc4c9241a7c0a858694a4d0912fdbe67d591b","src/handshake/mod.rs":"49a018f60620ccb7e198bebdef8026996c52aa9374fe5dfd6306605bf6e0a13a","src/handshake/refs/async_io.rs":"1f8143928517f5dcdbeb01b4f98774cf17afe6e37db75558752599ba7b88fd20","src/handshake/refs/blocking_io.rs":"9475538f6b90e46174438a08f89b0cc5ba938644ae409d5c32a5d9fd3e023862","src/handshake/refs/mod.rs":"2bd46c247a6b61095942992a7f036a6c0ba235aa11bab6bece92995dc31f48f6","src/handshake/refs/shared.rs":"ab92275101ac597f06d9e09c1192566a707ad730d330ba385e19bd5c499b15ae","src/handshake/refs/tests.rs":"9e7707faafb08d3e2cfb83efe7ee1bee52504ec9ee633eb168732bc18d2936ce","src/lib.rs":"37d70654d2b4bca30f53681b62888bd0b69cc143ee3e5239089842065f1c0b52","src/ls_refs.rs":"8e9003cd2619c64cadf5a2f7b94eb2bb0374898279a1af52b3eeab8167cb678d","src/remote_progress.rs":"cbcb30386c67c86b42f10af863edb72fdc920367aa320bcaf2c54190bd464f43","src/util.rs":"d83861fd81167f09ba0e93278703f827b201299e1991382f6274b6ba8abce6cd"},"package":"92a17058b45c461f0847528c5fb6ee6e76115e026979eb2d2202f98ee94f6c24"}
\ No newline at end of file diff --git a/vendor/gix-protocol/CHANGELOG.md b/vendor/gix-protocol/CHANGELOG.md index fc6468c1c..e2309d1b8 100644 --- a/vendor/gix-protocol/CHANGELOG.md +++ b/vendor/gix-protocol/CHANGELOG.md @@ -5,6 +5,130 @@ 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.33.2 (2023-06-10) + +### New Features + + - <csr-id-c8e8b9fc55486215bda4c380d3c84a6c6ae5f602/> support `capabilities^{}` syntax to announce caps in empty repos under V1 + This is supposed to work for existing code, but doesn't in our case as we really + want to associate a branch. In this case, we can ignore the ref as it's a null + hash anyway. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 2 commits contributed to the release. + - 2 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** + - Prepare changelogs prior to release ([`298f3d7`](https://github.com/Byron/gitoxide/commit/298f3d7359c5b183314d8c584e45dcdd559d88b3)) + - Support `capabilities^{}` syntax to announce caps in empty repos under V1 ([`c8e8b9f`](https://github.com/Byron/gitoxide/commit/c8e8b9fc55486215bda4c380d3c84a6c6ae5f602)) +</details> + +## 0.33.1 (2023-06-07) + +### Bug Fixes + + - <csr-id-88670c2ff995e4478f4a40b2733c6c8ca811fa15/> assure we don't stop early on NAK if READY was sent to handle V1 specialty. + Seeing READY means a pack will follow, which is exactly the kind of knowledge we want. + Thus we now either listen to the client OR to what the server says. + + Note that this remedy relies on `multi-ack-detailed`, which some very old servers might + not support. For those we would be out-of-luck, but that seems acceptable. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 2 commits contributed to the release. + - 1 commit was understood as [conventional](https://www.conventionalcommits.org). + - 1 unique issue was worked on: [#882](https://github.com/Byron/gitoxide/issues/882) + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **[#882](https://github.com/Byron/gitoxide/issues/882)** + - Assure we don't stop early on NAK if READY was sent to handle V1 specialty. ([`88670c2`](https://github.com/Byron/gitoxide/commit/88670c2ff995e4478f4a40b2733c6c8ca811fa15)) + * **Uncategorized** + - Release gix-protocol v0.33.1 ([`9c99ed3`](https://github.com/Byron/gitoxide/commit/9c99ed30162081a7f26d72e0ed26966ff62d2b1c)) +</details> + +## 0.33.0 (2023-06-06) + +### New Features + + - <csr-id-877aa2921d8491d301945f86d5a69382e40fb081/> Add `fetch::Arguments::is_stateless()` to aid proper use of arguments. + When arguments are used, haves are reset every round in stateless protocols, while + everything else is repeated. However, this also means that previously confirmed common + commits aren't repeated unless this is specifically implemented by the user of `Arguments`. + + That caller can now easily determine if negotiations have to be compensated for. + + Please note that `Arguments` explicitly doesn't implement repeating of all prior arguments, which + would also repeat a lot of *in-vain* haves. + +### Bug Fixes + + - <csr-id-c5dc7b4c43f07c04cdfb218de03e6725ff3fdb64/> `include-tag` is now properly handled in V1 fetch arguments + Previously it would be added like it's V2 arguments, which makes using it + in V1 impossible. + +### Bug Fixes (BREAKING) + + - <csr-id-6a3c02131c9ebca911be5f751e5a6c67fbdbf609/> make V1 stateless negotations work. + This is done by working around another V1 negotiation oddity + by exploiting client-side knowledge. For very old servers, we probably + wouldn't be able to do multi-rounds without dead-locking, but with + recent-enough (probably 10 years or so) old git servers all should + work fine. + + All this to not actually have to implement the V1 strangeness, allowing + our code to work smoothly with all permutations of stateless/stateful connections + and V1/V2 interactions, with a single high-level implementation essentially. + +### Commit Statistics + +<csr-read-only-do-not-edit/> + + - 13 commits contributed to the release over the course of 12 calendar days. + - 40 days passed between releases. + - 3 commits were understood as [conventional](https://www.conventionalcommits.org). + - 0 issues like '(#ID)' were seen in commit messages + +### Commit Details + +<csr-read-only-do-not-edit/> + +<details><summary>view details</summary> + + * **Uncategorized** + - Release gix-date v0.5.1, gix-hash v0.11.2, gix-features v0.30.0, gix-actor v0.21.0, gix-path v0.8.1, gix-glob v0.8.0, gix-quote v0.4.4, gix-attributes v0.13.0, gix-chunk v0.4.2, gix-commitgraph v0.16.0, gix-config-value v0.12.1, gix-fs v0.2.0, gix-tempfile v6.0.0, gix-utils v0.1.2, gix-lock v6.0.0, gix-validate v0.7.5, gix-object v0.30.0, gix-ref v0.30.0, gix-sec v0.8.1, gix-config v0.23.0, gix-command v0.2.5, gix-prompt v0.5.1, gix-url v0.19.0, gix-credentials v0.15.0, gix-diff v0.30.0, gix-discover v0.19.0, gix-hashtable v0.2.1, gix-ignore v0.3.0, gix-bitmap v0.2.4, gix-traverse v0.26.0, gix-index v0.17.0, gix-mailmap v0.13.0, gix-revision v0.15.0, gix-negotiate v0.2.0, gix-pack v0.36.0, gix-odb v0.46.0, gix-packetline v0.16.2, gix-transport v0.32.0, gix-protocol v0.33.0, gix-refspec v0.11.0, gix-worktree v0.18.0, gix v0.45.0, safety bump 29 crates ([`9a9fa96`](https://github.com/Byron/gitoxide/commit/9a9fa96fa8a722bddc5c3b2270b0edf8f6615141)) + - Prepare changelogs prior to release ([`8f15cec`](https://github.com/Byron/gitoxide/commit/8f15cec1ec7d5a9d56bb158f155011ef2bb3539b)) + - Merge branch 'integrate-gix-negotiate' ([`ae845de`](https://github.com/Byron/gitoxide/commit/ae845dea6cee6523c88a23d7a14293589cf8092f)) + - Make V1 stateless negotations work. ([`6a3c021`](https://github.com/Byron/gitoxide/commit/6a3c02131c9ebca911be5f751e5a6c67fbdbf609)) + - `include-tag` is now properly handled in V1 fetch arguments ([`c5dc7b4`](https://github.com/Byron/gitoxide/commit/c5dc7b4c43f07c04cdfb218de03e6725ff3fdb64)) + - Add `fetch::Arguments::is_stateless()` to aid proper use of arguments. ([`877aa29`](https://github.com/Byron/gitoxide/commit/877aa2921d8491d301945f86d5a69382e40fb081)) + - Adapt to changes in `gix-transport` ([`60eaceb`](https://github.com/Byron/gitoxide/commit/60eaceb5cd4b9206e9262cf05d9036c31a7b7d11)) + - 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 '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)) +</details> + ## 0.32.0 (2023-04-27) A maintenance release without user-facing changes. @@ -13,7 +137,7 @@ A maintenance release without user-facing changes. <csr-read-only-do-not-edit/> - - 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 +148,7 @@ A maintenance release without user-facing changes. <details><summary>view details</summary> * **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)) </details> diff --git a/vendor/gix-protocol/Cargo.toml b/vendor/gix-protocol/Cargo.toml index 150acf93f..a0c498aba 100644 --- a/vendor/gix-protocol/Cargo.toml +++ b/vendor/gix-protocol/Cargo.toml @@ -13,10 +13,11 @@ edition = "2021" rust-version = "1.64" name = "gix-protocol" -version = "0.32.0" +version = "0.33.2" authors = ["Sebastian Thiel <sebastian.thiel@icloud.com>"] include = [ "src/**/*", + "LICENSE-*", "CHANGELOG.md", "!**/tests/**/*", ] @@ -76,17 +77,17 @@ version = "1.12.0" optional = true [dependencies.gix-credentials] -version = "^0.14.0" +version = "^0.15.0" [dependencies.gix-features] -version = "^0.29.0" +version = "^0.30.0" features = ["progress"] [dependencies.gix-hash] -version = "^0.11.1" +version = "^0.11.2" [dependencies.gix-transport] -version = "^0.31.0" +version = "^0.32.0" [dependencies.maybe-async] version = "0.2.6" @@ -110,7 +111,7 @@ version = "1.9.0" features = ["attributes"] [dev-dependencies.gix-packetline] -version = "^0.16.0" +version = "^0.16.2" [features] async-client = [ diff --git a/vendor/gix-protocol/LICENSE-APACHE b/vendor/gix-protocol/LICENSE-APACHE new file mode 100644 index 000000000..a51f59a06 --- /dev/null +++ b/vendor/gix-protocol/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-protocol/LICENSE-MIT b/vendor/gix-protocol/LICENSE-MIT new file mode 100644 index 000000000..b58e818f1 --- /dev/null +++ b/vendor/gix-protocol/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-protocol/src/command/mod.rs b/vendor/gix-protocol/src/command/mod.rs index d560220d0..1216ba625 100644 --- a/vendor/gix-protocol/src/command/mod.rs +++ b/vendor/gix-protocol/src/command/mod.rs @@ -60,7 +60,7 @@ mod with_io { match self { Command::LsRefs => &[], Command::Fetch => match version { - gix_transport::Protocol::V1 => &[ + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => &[ "multi_ack", "thin-pack", "side-band", @@ -120,7 +120,7 @@ mod with_io { ) -> Vec<Feature> { match self { Command::Fetch => match version { - gix_transport::Protocol::V1 => { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { let has_multi_ack_detailed = server_capabilities.contains("multi_ack_detailed"); let has_sideband_64k = server_capabilities.contains("side-band-64k"); self.all_features(version) @@ -173,7 +173,7 @@ mod with_io { panic!("{}: argument {} is not known or allowed", self.as_str(), arg); } match version { - gix_transport::Protocol::V1 => { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { for (feature, _) in features { if server .iter() diff --git a/vendor/gix-protocol/src/fetch/arguments/async_io.rs b/vendor/gix-protocol/src/fetch/arguments/async_io.rs index 3984ec610..fc876d02c 100644 --- a/vendor/gix-protocol/src/fetch/arguments/async_io.rs +++ b/vendor/gix-protocol/src/fetch/arguments/async_io.rs @@ -14,7 +14,7 @@ impl Arguments { assert!(add_done_argument, "If there are no haves, is_done must be true."); } match self.version { - gix_transport::Protocol::V1 => { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { let (on_into_read, retained_state) = self.prepare_v1( transport.connection_persists_across_multiple_requests(), add_done_argument, diff --git a/vendor/gix-protocol/src/fetch/arguments/blocking_io.rs b/vendor/gix-protocol/src/fetch/arguments/blocking_io.rs index b49d1a1ba..571792148 100644 --- a/vendor/gix-protocol/src/fetch/arguments/blocking_io.rs +++ b/vendor/gix-protocol/src/fetch/arguments/blocking_io.rs @@ -15,7 +15,7 @@ impl Arguments { assert!(add_done_argument, "If there are no haves, is_done must be true."); } match self.version { - gix_transport::Protocol::V1 => { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { let (on_into_read, retained_state) = self.prepare_v1( transport.connection_persists_across_multiple_requests(), add_done_argument, diff --git a/vendor/gix-protocol/src/fetch/arguments/mod.rs b/vendor/gix-protocol/src/fetch/arguments/mod.rs index 39c9eee3a..1adf993bb 100644 --- a/vendor/gix-protocol/src/fetch/arguments/mod.rs +++ b/vendor/gix-protocol/src/fetch/arguments/mod.rs @@ -49,20 +49,20 @@ impl Arguments { pub fn can_use_deepen(&self) -> bool { self.shallow } - /// Return true if the 'deepen_since' capability is supported. + /// Return true if the '`deepen_since`' capability is supported. /// /// This is relevant for partial clones when using `--depth X` and retrieving additional history /// based on a date beyond which all history should be present. pub fn can_use_deepen_since(&self) -> bool { self.deepen_since } - /// Return true if the 'deepen_not' capability is supported. + /// Return true if the '`deepen_not`' capability is supported. /// /// This is relevant for partial clones when using `--depth X`. pub fn can_use_deepen_not(&self) -> bool { self.deepen_not } - /// Return true if the 'deepen_relative' capability is supported. + /// Return true if the '`deepen_relative`' capability is supported. /// /// This is relevant for partial clones when using `--depth X`. pub fn can_use_deepen_relative(&self) -> bool { @@ -78,6 +78,18 @@ impl Arguments { pub fn can_use_include_tag(&self) -> bool { self.supports_include_tag } + /// Return true if we will use a stateless mode of operation, which can be decided in conjunction with `transport_is_stateless`. + /// + /// * we are always stateless if the transport is stateless, i.e. doesn't support multiple interactions with a single connection. + /// * we are always stateless if the protocol version is `2` + /// * otherwise we may be stateful. + pub fn is_stateless(&self, transport_is_stateless: bool) -> bool { + #[cfg(any(feature = "async-client", feature = "blocking-client"))] + let res = transport_is_stateless || self.version == gix_transport::Protocol::V2; + #[cfg(not(any(feature = "async-client", feature = "blocking-client")))] + let res = transport_is_stateless; + res + } /// Add the given `id` pointing to a commit to the 'want' list. /// @@ -153,7 +165,18 @@ impl Arguments { pub fn use_include_tag(&mut self) { debug_assert!(self.supports_include_tag, "'include-tag' feature required"); if self.supports_include_tag { - self.args.push("include-tag".into()); + match self.version { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { + let features = self + .features_for_first_want + .as_mut() + .expect("call use_include_tag before want()"); + features.push("include-tag".into()) + } + gix_transport::Protocol::V2 => { + self.args.push("include-tag".into()); + } + } } } fn prefixed(&mut self, prefix: &str, value: impl fmt::Display) { @@ -173,13 +196,16 @@ impl Arguments { let mut deepen_relative = shallow; let supports_include_tag; let (initial_arguments, features_for_first_want) = match version { - gix_transport::Protocol::V1 => { + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => { deepen_since = has("deepen-since"); deepen_not = has("deepen-not"); deepen_relative = has("deepen-relative"); supports_include_tag = has("include-tag"); let baked_features = features .iter() + .filter( + |(f, _)| *f != "include-tag", /* not a capability in that sense, needs to be turned on by caller later */ + ) .map(|(n, v)| match v { Some(v) => format!("{n}={v}"), None => n.to_string(), diff --git a/vendor/gix-protocol/src/fetch/delegate.rs b/vendor/gix-protocol/src/fetch/delegate.rs index d4b900f66..e90022d41 100644 --- a/vendor/gix-protocol/src/fetch/delegate.rs +++ b/vendor/gix-protocol/src/fetch/delegate.rs @@ -40,7 +40,7 @@ pub trait DelegateBlocking { /// Note that some arguments are preset based on typical use, and `features` are preset to maximize options. /// The `server` capabilities can be used to see which additional capabilities the server supports as per the handshake which happened prior. /// - /// If the delegate returns [`ls_refs::Action::Skip`], no 'ls-refs` command is sent to the server. + /// If the delegate returns [`ls_refs::Action::Skip`], no `ls-refs` command is sent to the server. /// /// Note that this is called only if we are using protocol version 2. fn prepare_ls_refs( @@ -55,7 +55,7 @@ pub trait DelegateBlocking { /// Called before invoking the 'fetch' interaction with `features` pre-filled for typical use /// and to maximize capabilities to allow aborting an interaction early. /// - /// `refs` is a list of known references on the remote based on the handshake or a prior call to ls_refs. + /// `refs` is a list of known references on the remote based on the handshake or a prior call to `ls_refs`. /// These can be used to abort early in case the refs are already known here. /// /// As there will be another call allowing to post arguments conveniently in the correct format, i.e. `want hex-oid`, diff --git a/vendor/gix-protocol/src/fetch/response/async_io.rs b/vendor/gix-protocol/src/fetch/response/async_io.rs index 550ed46b6..c510a1ad4 100644 --- a/vendor/gix-protocol/src/fetch/response/async_io.rs +++ b/vendor/gix-protocol/src/fetch/response/async_io.rs @@ -32,15 +32,22 @@ async fn parse_v2_section<T>( impl Response { /// Parse a response of the given `version` of the protocol from `reader`. + /// + /// `client_expects_pack` is only relevant for V1 stateful connections, and if `false`, causes us to stop parsing when seeing `NAK`, + /// and if `true` we will keep parsing until we get a pack as the client already signalled to the server that it's done. + /// This way of doing things allows us to exploit knowledge about more recent versions of the protocol, which keeps code easier + /// and more localized without having to support all the cruft that there is. pub async fn from_line_reader( version: Protocol, reader: &mut (impl client::ExtendedBufRead + Unpin), + client_expects_pack: bool, ) -> Result<Response, response::Error> { match version { - Protocol::V1 => { + Protocol::V0 | Protocol::V1 => { let mut line = String::new(); let mut acks = Vec::<Acknowledgement>::new(); let mut shallows = Vec::<ShallowUpdate>::new(); + let mut saw_ready = false; let has_pack = 'lines: loop { line.clear(); let peeked_line = match reader.peek_data_line().await { @@ -48,8 +55,8 @@ impl Response { // This special case (hang/block forever) deals with a single NAK being a legitimate EOF sometimes // Note that this might block forever in stateful connections as there it's not really clear // if something will be following or not by just looking at the response. Instead you have to know - // the arguments sent to the server and count response lines based on intricate knowledge on how the - // server works. + // [a lot](https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/fetch-pack.c#L583-L594) + // to deal with this correctly. // For now this is acceptable, as V2 can be used as a workaround, which also is the default. Some(Err(err)) if err.kind() == io::ErrorKind::UnexpectedEof => break 'lines false, Some(Err(err)) => return Err(err.into()), @@ -80,6 +87,11 @@ impl Response { 0, "consuming a peeked line works" ); + // When the server sends ready, we know there is going to be a pack so no need to stop early. + saw_ready |= matches!(acks.last(), Some(Acknowledgement::Ready)); + if let Some(Acknowledgement::Nak) = acks.last().filter(|_| !client_expects_pack && !saw_ready) { + break 'lines false; + } }; Ok(Response { acks, diff --git a/vendor/gix-protocol/src/fetch/response/blocking_io.rs b/vendor/gix-protocol/src/fetch/response/blocking_io.rs index 7a3f2deb3..309f5a7c5 100644 --- a/vendor/gix-protocol/src/fetch/response/blocking_io.rs +++ b/vendor/gix-protocol/src/fetch/response/blocking_io.rs @@ -32,15 +32,22 @@ fn parse_v2_section<T>( impl Response { /// Parse a response of the given `version` of the protocol from `reader`. + /// + /// `client_expects_pack` is only relevant for V1 stateful connections, and if `false`, causes us to stop parsing when seeing `NAK`, + /// and if `true` we will keep parsing until we get a pack as the client already signalled to the server that it's done. + /// This way of doing things allows us to exploit knowledge about more recent versions of the protocol, which keeps code easier + /// and more localized without having to support all the cruft that there is. pub fn from_line_reader( version: Protocol, reader: &mut impl client::ExtendedBufRead, + client_expects_pack: bool, ) -> Result<Response, response::Error> { match version { - Protocol::V1 => { + Protocol::V0 | Protocol::V1 => { let mut line = String::new(); let mut acks = Vec::<Acknowledgement>::new(); let mut shallows = Vec::<ShallowUpdate>::new(); + let mut saw_ready = false; let has_pack = 'lines: loop { line.clear(); let peeked_line = match reader.peek_data_line() { @@ -48,8 +55,8 @@ impl Response { // This special case (hang/block forever) deals with a single NAK being a legitimate EOF sometimes // Note that this might block forever in stateful connections as there it's not really clear // if something will be following or not by just looking at the response. Instead you have to know - // the arguments sent to the server and count response lines based on intricate knowledge on how the - // server works. + // [a lot](https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/fetch-pack.c#L583-L594) + // to deal with this correctly. // For now this is acceptable, as V2 can be used as a workaround, which also is the default. Some(Err(err)) if err.kind() == io::ErrorKind::UnexpectedEof => break 'lines false, Some(Err(err)) => return Err(err.into()), @@ -76,6 +83,11 @@ impl Response { break 'lines true; } assert_ne!(reader.readline_str(&mut line)?, 0, "consuming a peeked line works"); + // When the server sends ready, we know there is going to be a pack so no need to stop early. + saw_ready |= matches!(acks.last(), Some(Acknowledgement::Ready)); + if let Some(Acknowledgement::Nak) = acks.last().filter(|_| !client_expects_pack && !saw_ready) { + break 'lines false; + } }; Ok(Response { acks, diff --git a/vendor/gix-protocol/src/fetch/response/mod.rs b/vendor/gix-protocol/src/fetch/response/mod.rs index bfb4beb83..5f2f7f007 100644 --- a/vendor/gix-protocol/src/fetch/response/mod.rs +++ b/vendor/gix-protocol/src/fetch/response/mod.rs @@ -170,7 +170,7 @@ impl Response { /// make it easy to maintain all versions with a single code base that aims to be and remain maintainable. pub fn check_required_features(version: Protocol, features: &[Feature]) -> Result<(), Error> { match version { - Protocol::V1 => { + Protocol::V0 | Protocol::V1 => { let has = |name: &str| features.iter().any(|f| f.0 == name); // Let's focus on V2 standards, and simply not support old servers to keep our code simpler if !has("multi_ack_detailed") { diff --git a/vendor/gix-protocol/src/fetch/tests.rs b/vendor/gix-protocol/src/fetch/tests.rs index 5a1902ad2..80dc752dd 100644 --- a/vendor/gix-protocol/src/fetch/tests.rs +++ b/vendor/gix-protocol/src/fetch/tests.rs @@ -163,7 +163,7 @@ mod arguments { async fn include_tag() { let mut out = Vec::new(); let mut t = transport(&mut out, true); - let mut arguments = arguments_v1(["include-tag", "feature-b"].iter().cloned()); + let mut arguments = arguments_v1(["include-tag", "feature-b"].iter().copied()); assert!(arguments.can_use_include_tag()); arguments.use_include_tag(); @@ -171,8 +171,7 @@ mod arguments { arguments.send(&mut t, true).await.expect("sending to buffer to work"); assert_eq!( out.as_bstr(), - b"0048want ff333369de1221f9bfbbe03a3a13e9a09bc1ffff include-tag feature-b -0010include-tag + b"0048want ff333369de1221f9bfbbe03a3a13e9a09bc1ffff feature-b include-tag 00000009done " .as_bstr() @@ -180,10 +179,29 @@ mod arguments { } #[maybe_async::test(feature = "blocking-client", async(feature = "async-client", async_std::test))] + async fn no_include_tag() { + let mut out = Vec::new(); + let mut t = transport(&mut out, true); + let mut arguments = arguments_v1(["include-tag", "feature-b"].iter().copied()); + assert!(arguments.can_use_include_tag()); + + arguments.want(id("ff333369de1221f9bfbbe03a3a13e9a09bc1ffff")); + arguments.send(&mut t, true).await.expect("sending to buffer to work"); + assert_eq!( + out.as_bstr(), + b"003cwant ff333369de1221f9bfbbe03a3a13e9a09bc1ffff feature-b +00000009done +" + .as_bstr(), + "it's possible to not have it enabled, even though it's advertised by the server" + ); + } + + #[maybe_async::test(feature = "blocking-client", async(feature = "async-client", async_std::test))] async fn haves_and_wants_for_clone() { let mut out = Vec::new(); let mut t = transport(&mut out, true); - let mut arguments = arguments_v1(["feature-a", "feature-b"].iter().cloned()); + let mut arguments = arguments_v1(["feature-a", "feature-b"].iter().copied()); assert!( !arguments.can_use_include_tag(), "needs to be enabled by features in V1" @@ -298,6 +316,8 @@ mod arguments { let mut out = Vec::new(); let mut t = transport(&mut out, true); let mut arguments = arguments_v2(["feature-a", "shallow"].iter().copied()); + assert!(arguments.is_stateless(true), "V2 is stateless…"); + assert!(arguments.is_stateless(false), "…in all cases"); arguments.deepen(1); arguments.deepen_relative(); diff --git a/vendor/gix-protocol/src/fetch_fn.rs b/vendor/gix-protocol/src/fetch_fn.rs index 5899ed95f..64d457711 100644 --- a/vendor/gix-protocol/src/fetch_fn.rs +++ b/vendor/gix-protocol/src/fetch_fn.rs @@ -128,7 +128,12 @@ where if sideband_all { setup_remote_progress(&mut progress, &mut reader); } - let response = Response::from_line_reader(protocol_version, &mut reader).await?; + let response = Response::from_line_reader( + protocol_version, + &mut reader, + true, /* hack, telling us we don't want this delegate approach anymore */ + ) + .await?; previous_response = if response.has_pack() { progress.step(); progress.set_name("receiving pack"); diff --git a/vendor/gix-protocol/src/handshake/function.rs b/vendor/gix-protocol/src/handshake/function.rs index 1206ee363..6324fb3e1 100644 --- a/vendor/gix-protocol/src/handshake/function.rs +++ b/vendor/gix-protocol/src/handshake/function.rs @@ -77,10 +77,12 @@ where let parsed_refs = match refs { Some(mut refs) => { - assert_eq!( - actual_protocol, - gix_transport::Protocol::V1, - "Only V1 auto-responds with refs" + assert!( + matches!( + actual_protocol, + gix_transport::Protocol::V0 | gix_transport::Protocol::V1 + ), + "Only V(0|1) auto-responds with refs" ); Some( refs::from_v1_refs_received_as_part_of_handshake_and_capabilities(&mut refs, capabilities.iter()) diff --git a/vendor/gix-protocol/src/handshake/refs/shared.rs b/vendor/gix-protocol/src/handshake/refs/shared.rs index 1d0dfc256..046a2a1b1 100644 --- a/vendor/gix-protocol/src/handshake/refs/shared.rs +++ b/vendor/gix-protocol/src/handshake/refs/shared.rs @@ -123,6 +123,10 @@ pub(in crate::handshake::refs) fn parse_v1( } match path.strip_suffix(b"^{}") { Some(stripped) => { + if hex_hash.iter().all(|b| *b == b'0') && stripped == b"capabilities" { + // this is a special dummy-ref just for the sake of getting capabilities across in a repo that is empty. + return Ok(()); + } let (previous_path, tag) = out_refs .pop() diff --git a/vendor/gix-protocol/src/ls_refs.rs b/vendor/gix-protocol/src/ls_refs.rs index a31588894..d0b2e9ba0 100644 --- a/vendor/gix-protocol/src/ls_refs.rs +++ b/vendor/gix-protocol/src/ls_refs.rs @@ -1,7 +1,7 @@ mod error { use crate::handshake::refs::parse; - /// The error returned by [ls_refs()][crate::ls_refs()]. + /// The error returned by [`ls_refs()`][crate::ls_refs()]. #[derive(Debug, thiserror::Error)] #[allow(missing_docs)] pub enum Error { @@ -25,7 +25,7 @@ mod error { } pub use error::Error; -/// What to do after preparing ls-refs in [ls_refs()][crate::ls_refs()]. +/// What to do after preparing ls-refs in [`ls_refs()`][crate::ls_refs()]. #[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)] pub enum Action { /// Continue by sending a 'ls-refs' command. |