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
58 want_refs: vec!["refs/heads/main".into()],58 want_refs: vec!["refs/heads/main".into()],
59 ..CloneRefInWantDelegate::default()59 ..CloneRefInWantDelegate::default()
60 };60 };
61 let (delegate, out) = git_protocol::fetch(61 let mut transport = transport(
62 transport(62 out,
63 out,63 "v2/clone-ref-in-want.response",
64 "v2/clone-ref-in-want.response",64 Protocol::V2,
65 Protocol::V2,65 git_transport::client::git::ConnectMode::Daemon,
66 git_transport::client::git::ConnectMode::Daemon,66 );
67 ),67
68 let (delegate, _) = git_protocol::fetch(
69 &mut transport,
68 delegate,70 delegate,
69 git_protocol::credentials::helper,71 git_protocol::credentials::helper,
70 progress::Discard,72 progress::Discard,
@@ -81,7 +83,7 @@ async fn ref_in_want() -> crate::Result { · 10 unmodified lines
81 );83 );
82 assert_eq!(delegate.pack_bytes, 641, "Should get packfile");84 assert_eq!(delegate.pack_bytes, 641, "Should get packfile");
83 assert_eq!(85 assert_eq!(
84 out.into_inner().1.as_bstr(),86 transport.into_inner().1.as_bstr(),
85 format!(87 format!(
86 "002fgit-upload-pack does/not/matter\0\0version=2\00012command=fetch88 "002fgit-upload-pack does/not/matter\0\0version=2\00012command=fetch
87001aagent={}89001aagent={}