Skip to content

Commit 71ad8f3

Browse files
committed
fix: properly indicate the end of interaction
1 parent 6822689 commit 71ad8f3

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

gitoxide-core/src/net.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,20 @@ mod impls {
3636
}
3737

3838
#[cfg(any(feature = "async-client", feature = "blocking-client"))]
39-
pub use gix::protocol::transport::connect;
39+
#[gix::protocol::maybe_async::maybe_async]
40+
pub async fn connect<Url, E>(
41+
url: Url,
42+
options: gix::protocol::transport::client::connect::Options,
43+
) -> Result<
44+
gix::protocol::SendFlushOnDrop<Box<dyn gix::protocol::transport::client::Transport + Send>>,
45+
gix::protocol::transport::client::connect::Error,
46+
>
47+
where
48+
Url: TryInto<gix_url::Url, Error = E>,
49+
gix_url::parse::Error: From<E>,
50+
{
51+
Ok(gix::protocol::SendFlushOnDrop::new(
52+
gix::protocol::transport::connect(url, options).await?,
53+
false,
54+
))
55+
}

gitoxide-core/src/pack/receive.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ where
6464

6565
let agent = gix::protocol::agent(gix::env::agent());
6666
let mut handshake = gix::protocol::fetch::handshake(
67-
&mut transport,
67+
&mut transport.inner,
6868
gix::protocol::credentials::builtin,
6969
vec![("agent".into(), Some(agent.clone()))],
7070
&mut progress,
@@ -85,7 +85,7 @@ where
8585
&fetch_refspecs,
8686
gix::protocol::fetch::Context {
8787
handshake: &mut handshake,
88-
transport: &mut transport,
88+
transport: &mut transport.inner,
8989
user_agent: user_agent.clone(),
9090
trace_packetlines,
9191
},
@@ -114,7 +114,7 @@ where
114114
&ctx.should_interrupt,
115115
gix::protocol::fetch::Context {
116116
handshake: &mut handshake,
117-
transport: &mut transport,
117+
transport: &mut transport.inner,
118118
user_agent,
119119
trace_packetlines,
120120
},

0 commit comments

Comments
 (0)