History

[transport] implement Transport for &mut T: Transport as well

Sebastian Thiel committed 5 years ago

Commit 372fb811 parent f2485574 files · +63 −8Browse files

Showing the changes to git-protocol (1 of 4 files). Show all

Unified · Split

git-protocol/tests/fetch/v2.rs+10−8
@@ -58,13 +58,15 @@ async fn ref_in_want() -> crate::Result { · 57 unmodified lines
5858 want_refs: vec!["refs/heads/main".into()],
5959 ..CloneRefInWantDelegate::default()
6060 };
61− let (delegate, out) = git_protocol::fetch(
62− transport(
63− out,
64− "v2/clone-ref-in-want.response",
65− Protocol::V2,
66− git_transport::client::git::ConnectMode::Daemon,
67− ),
61+ let mut transport = transport(
62+ out,
63+ "v2/clone-ref-in-want.response",
64+ Protocol::V2,
65+ git_transport::client::git::ConnectMode::Daemon,
66+ );
67+
68+ let (delegate, _) = git_protocol::fetch(
69+ &mut transport,
6870 delegate,
6971 git_protocol::credentials::helper,
7072 progress::Discard,
@@ -81,7 +83,7 @@ async fn ref_in_want() -> crate::Result { · 10 unmodified lines
8183 );
8284 assert_eq!(delegate.pack_bytes, 641, "Should get packfile");
8385 assert_eq!(
84− out.into_inner().1.as_bstr(),
86+ transport.into_inner().1.as_bstr(),
8587 format!(
8688 "002fgit-upload-pack does/not/matter\0\0version=2\00012command=fetch
8789 001aagent={}