Skip to content

Commit 6e12806

Browse files
committed
adapt to changes in gix-transport
1 parent b3d7209 commit 6e12806

File tree

8 files changed

+15
-13
lines changed

8 files changed

+15
-13
lines changed

gix-protocol/src/command/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ mod with_io {
6060
match self {
6161
Command::LsRefs => &[],
6262
Command::Fetch => match version {
63-
gix_transport::Protocol::V1 => &[
63+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => &[
6464
"multi_ack",
6565
"thin-pack",
6666
"side-band",
@@ -120,7 +120,7 @@ mod with_io {
120120
) -> Vec<Feature> {
121121
match self {
122122
Command::Fetch => match version {
123-
gix_transport::Protocol::V1 => {
123+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => {
124124
let has_multi_ack_detailed = server_capabilities.contains("multi_ack_detailed");
125125
let has_sideband_64k = server_capabilities.contains("side-band-64k");
126126
self.all_features(version)
@@ -173,7 +173,7 @@ mod with_io {
173173
panic!("{}: argument {} is not known or allowed", self.as_str(), arg);
174174
}
175175
match version {
176-
gix_transport::Protocol::V1 => {
176+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => {
177177
for (feature, _) in features {
178178
if server
179179
.iter()

gix-protocol/src/fetch/arguments/async_io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ impl Arguments {
1414
assert!(add_done_argument, "If there are no haves, is_done must be true.");
1515
}
1616
match self.version {
17-
gix_transport::Protocol::V1 => {
17+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => {
1818
let (on_into_read, retained_state) = self.prepare_v1(
1919
transport.connection_persists_across_multiple_requests(),
2020
add_done_argument,

gix-protocol/src/fetch/arguments/blocking_io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl Arguments {
1515
assert!(add_done_argument, "If there are no haves, is_done must be true.");
1616
}
1717
match self.version {
18-
gix_transport::Protocol::V1 => {
18+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => {
1919
let (on_into_read, retained_state) = self.prepare_v1(
2020
transport.connection_persists_across_multiple_requests(),
2121
add_done_argument,

gix-protocol/src/fetch/arguments/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ impl Arguments {
173173
let mut deepen_relative = shallow;
174174
let supports_include_tag;
175175
let (initial_arguments, features_for_first_want) = match version {
176-
gix_transport::Protocol::V1 => {
176+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1 => {
177177
deepen_since = has("deepen-since");
178178
deepen_not = has("deepen-not");
179179
deepen_relative = has("deepen-relative");

gix-protocol/src/fetch/response/async_io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Response {
3737
reader: &mut (impl client::ExtendedBufRead + Unpin),
3838
) -> Result<Response, response::Error> {
3939
match version {
40-
Protocol::V1 => {
40+
Protocol::V0 | Protocol::V1 => {
4141
let mut line = String::new();
4242
let mut acks = Vec::<Acknowledgement>::new();
4343
let mut shallows = Vec::<ShallowUpdate>::new();

gix-protocol/src/fetch/response/blocking_io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl Response {
3737
reader: &mut impl client::ExtendedBufRead,
3838
) -> Result<Response, response::Error> {
3939
match version {
40-
Protocol::V1 => {
40+
Protocol::V0 | Protocol::V1 => {
4141
let mut line = String::new();
4242
let mut acks = Vec::<Acknowledgement>::new();
4343
let mut shallows = Vec::<ShallowUpdate>::new();

gix-protocol/src/fetch/response/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Response {
170170
/// make it easy to maintain all versions with a single code base that aims to be and remain maintainable.
171171
pub fn check_required_features(version: Protocol, features: &[Feature]) -> Result<(), Error> {
172172
match version {
173-
Protocol::V1 => {
173+
Protocol::V0 | Protocol::V1 => {
174174
let has = |name: &str| features.iter().any(|f| f.0 == name);
175175
// Let's focus on V2 standards, and simply not support old servers to keep our code simpler
176176
if !has("multi_ack_detailed") {

gix-protocol/src/handshake/function.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ where
7777

7878
let parsed_refs = match refs {
7979
Some(mut refs) => {
80-
assert_eq!(
81-
actual_protocol,
82-
gix_transport::Protocol::V1,
83-
"Only V1 auto-responds with refs"
80+
assert!(
81+
matches!(
82+
actual_protocol,
83+
gix_transport::Protocol::V0 | gix_transport::Protocol::V1
84+
),
85+
"Only V(0|1) auto-responds with refs"
8486
);
8587
Some(
8688
refs::from_v1_refs_received_as_part_of_handshake_and_capabilities(&mut refs, capabilities.iter())

0 commit comments

Comments
 (0)