Skip to content

Commit

Permalink
[clone] none the wiser - it really looks like everything is alright…
Browse files Browse the repository at this point in the history
…at least when reading everything to a buffer right away.
  • Loading branch information
Byron committed Sep 11, 2020
1 parent edf1540 commit 3b8d613
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions git-protocol/tests/fetch/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod v2 {

#[test]
fn clone_with_sidebands() -> crate::Result {
let mut provider = mock_reader("v2/clone-only.response");
let mut provider = mock_reader("v2/clone-only-2.response");
let mut reader = provider.as_read_without_sidebands();
let r = fetch::Response::from_line_reader(Protocol::V2, &mut reader)?;
assert!(r.acknowledgements().is_empty(), "it should go straight to the packfile");
Expand All @@ -101,8 +101,12 @@ mod v2 {
assert!(!is_err, "fixture does not have an error");
}) as git_transport::client::HandleProgress));
let bytes_read = reader.read_to_end(&mut buf)?;
assert_eq!(bytes_read, 876, "should be able to read the whole pack");
assert_eq!(bytes_read, 1643, "should be able to read the whole pack");
assert_eq!(&buf[..4], b"PACK");
assert_eq!(
git_object::owned::Id::from_20_bytes(&buf[buf.len() - 20..]).to_string(),
"f34c9be7e0c3ef2c3ed7c62cc7791dbf6dc5ec9a"
);
Ok(())
}

Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions git-transport/src/client/http/curl/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ pub fn new() -> (
handle.http_headers(headers)?;
handle.transfer_encoding(false)?;
handle.connect_timeout(Duration::from_secs(20))?;
// handle.proxy("http://localhost:9090")?; // DEBUG
let low_bytes_per_second = 1024;
handle.low_speed_limit(low_bytes_per_second)?;
handle.low_speed_time(Duration::from_secs(20))?;
Expand Down

0 comments on commit 3b8d613

Please sign in to comment.