History

adapt to changes in `git-protocol`

Sebastian Thiel committed 3 years ago

Commit bd708471 parent 09070a74 files · +11 −18Browse files

Unified · Split

4 files
  1. git-repository/src/config/cache/access.rs +1 −1
  2. git-repository/src/remote/connection/fetch/mod.rs +2 −2
  3. git-repository/src/remote/connection/fetch/receive_pack.rs +4 −10
  4. git-repository/src/remote/connection/ref_map.rs +4 −5
git-repository/src/config/cache/access.rs+1−1
@@ -55,7 +55,7 @@ impl Cache { · 54 unmodified lines
5555 .unwrap_or_else(|| crate::env::agent().into())
5656 })
5757 .to_owned();
58− ("agent", Some(git_protocol::fetch::agent(agent).into()))
58+ ("agent", Some(git_protocol::agent(agent).into()))
5959 }
6060
6161 pub(crate) fn personas(&self) -> &identity::Personas {
git-repository/src/remote/connection/fetch/mod.rs+2−2
@@ -187,14 +187,14 @@ where · 186 unmodified lines
187187 // Right now we block the executor by forcing this communication, but that only
188188 // happens if the user didn't actually try to receive a pack, which consumes the
189189 // connection in an async context.
190− git_protocol::futures_lite::future::block_on(git_protocol::fetch::indicate_end_of_interaction(
190+ git_protocol::futures_lite::future::block_on(git_protocol::indicate_end_of_interaction(
191191 &mut con.transport,
192192 ))
193193 .ok();
194194 }
195195 #[cfg(not(feature = "async-network-client"))]
196196 {
197− git_protocol::fetch::indicate_end_of_interaction(&mut con.transport).ok();
197+ git_protocol::indicate_end_of_interaction(&mut con.transport).ok();
198198 }
199199 }
200200 }
git-repository/src/remote/connection/fetch/receive_pack.rs+4−10
@@ -68,7 +68,7 @@ where · 67 unmodified lines
6868 let handshake = &self.ref_map.handshake;
6969 let protocol_version = handshake.server_protocol_version;
7070
71− let fetch = git_protocol::fetch::Command::Fetch;
71+ let fetch = git_protocol::Command::Fetch;
7272 let progress = &mut con.progress;
7373 let repo = con.remote.repo;
7474 let fetch_features = {
@@ -103,9 +103,7 @@ where · 28 unmodified lines
103103 previous_response.as_ref(),
104104 ) {
105105 Ok(_) if arguments.is_empty() => {
106− git_protocol::fetch::indicate_end_of_interaction(&mut con.transport)
107− .await
108− .ok();
106+ git_protocol::indicate_end_of_interaction(&mut con.transport).await.ok();
109107 return Ok(Outcome {
110108 ref_map: std::mem::take(&mut self.ref_map),
111109 status: Status::NoChange,
@@ -113,9 +111,7 @@ where · 1 unmodified line
113111 }
114112 Ok(is_done) => is_done,
115113 Err(err) => {
116− git_protocol::fetch::indicate_end_of_interaction(&mut con.transport)
117− .await
118− .ok();
114+ git_protocol::indicate_end_of_interaction(&mut con.transport).await.ok();
119115 return Err(err.into());
120116 }
121117 };
@@ -169,9 +165,7 @@ where · 47 unmodified lines
169165 };
170166
171167 if matches!(protocol_version, git_protocol::transport::Protocol::V2) {
172− git_protocol::fetch::indicate_end_of_interaction(&mut con.transport)
173− .await
174− .ok();
168+ git_protocol::indicate_end_of_interaction(&mut con.transport).await.ok();
175169 }
176170
177171 let update_refs = refs::update(
git-repository/src/remote/connection/ref_map.rs+4−5
@@ -25,7 +25,7 @@ pub enum Error { · 24 unmodified lines
2525 #[error("The object format {format:?} as used by the remote is unsupported")]
2626 UnknownObjectFormat { format: BString },
2727 #[error(transparent)]
28− ListRefs(#[from] git_protocol::fetch::refs::Error),
28+ ListRefs(#[from] git_protocol::ls_refs::Error),
2929 #[error(transparent)]
3030 Transport(#[from] git_protocol::transport::client::Error),
3131 #[error(transparent)]
@@ -80,7 +80,7 @@ where · 48 unmodified lines
8080 #[git_protocol::maybe_async::maybe_async]
8181 pub async fn ref_map(mut self, options: Options) -> Result<fetch::RefMap, Error> {
8282 let res = self.ref_map_inner(options).await;
83− git_protocol::fetch::indicate_end_of_interaction(&mut self.transport)
83+ git_protocol::indicate_end_of_interaction(&mut self.transport)
8484 .await
8585 .ok();
8686 res
@@ -181,9 +181,8 @@ where · 94 unmodified lines
181181 None => {
182182 let specs = &self.remote.fetch_specs;
183183 let agent_feature = self.remote.repo.config.user_agent_tuple();
184− git_protocol::fetch::refs(
184+ git_protocol::ls_refs(
185185 &mut self.transport,
186− outcome.server_protocol_version,
187186 &outcome.capabilities,
188187 move |_capabilities, arguments, features| {
189188 features.push(agent_feature);
@@ -201,7 +200,7 @@ where · 11 unmodified lines
201200 }
202201 }
203202 }
204− Ok(git_protocol::fetch::delegate::LsRefsAction::Continue)
203+ Ok(git_protocol::ls_refs::Action::Continue)
205204 },
206205 &mut self.progress,
207206 )