You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gix-protocol/src/fetch/response/async_io.rs
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,16 @@ impl Response {
37
37
/// and if `true` we will keep parsing until we get a pack as the client already signalled to the server that it's done.
38
38
/// This way of doing things allows us to exploit knowledge about more recent versions of the protocol, which keeps code easier
39
39
/// and more localized without having to support all the cruft that there is.
40
+
///
41
+
/// `wants_to_negotiate` should be `false` for clones which is when we don't have sent any haves. The reason for this flag to exist
42
+
/// is to predict how to parse V1 output only, and neither `client_expects_pack` nor `wants_to_negotiate` are relevant for V2.
43
+
/// This ugliness is in place to avoid having to resort to an [an even more complex ugliness](https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/fetch-pack.c#L583-L594)
44
+
/// that `git` has to use to predict how many acks are supposed to be read. We also genuinely hope that this covers it all….
Copy file name to clipboardExpand all lines: gix-protocol/src/fetch/response/blocking_io.rs
+10-1Lines changed: 10 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,10 +37,16 @@ impl Response {
37
37
/// and if `true` we will keep parsing until we get a pack as the client already signalled to the server that it's done.
38
38
/// This way of doing things allows us to exploit knowledge about more recent versions of the protocol, which keeps code easier
39
39
/// and more localized without having to support all the cruft that there is.
40
+
///
41
+
/// `wants_to_negotiate` should be `false` for clones which is when we don't have sent any haves. The reason for this flag to exist
42
+
/// is to predict how to parse V1 output only, and neither `client_expects_pack` nor `wants_to_negotiate` are relevant for V2.
43
+
/// This ugliness is in place to avoid having to resort to an [an even more complex ugliness](https://github.com/git/git/blob/9e49351c3060e1fa6e0d2de64505b7becf157f28/fetch-pack.c#L583-L594)
44
+
/// that `git` has to use to predict how many acks are supposed to be read. We also genuinely hope that this covers it all….
40
45
pubfnfrom_line_reader(
41
46
version:Protocol,
42
47
reader:&mutimpl client::ExtendedBufRead,
43
48
client_expects_pack:bool,
49
+
wants_to_negotiate:bool,
44
50
) -> Result<Response, response::Error>{
45
51
match version {
46
52
Protocol::V0 | Protocol::V1 => {
@@ -85,7 +91,10 @@ impl Response {
85
91
assert_ne!(reader.readline_str(&mut line)?,0,"consuming a peeked line works");
86
92
// When the server sends ready, we know there is going to be a pack so no need to stop early.
0 commit comments