Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 11, 2022
1 parent 84f12b4 commit e93768b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion git-repository/src/remote/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl<'repo> Remote<'repo> {
Connection {
remote: self,
authenticate: None,
transport_config: None,
transport_options: None,
transport,
progress,
}
Expand Down
2 changes: 1 addition & 1 deletion git-repository/src/remote/connection/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl<'a, 'repo, T, P> Connection<'a, 'repo, T, P> {
/// Use this method to provide transport configuration with custom backend configuration that is not configurable by other means and
/// custom to the application at hand.
pub fn with_transport_options(mut self, config: Box<dyn std::any::Any>) -> Self {
self.transport_config = Some(config);
self.transport_options = Some(config);
self
}
}
Expand Down
2 changes: 1 addition & 1 deletion git-repository/src/remote/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub type AuthenticateFn<'a> = Box<dyn FnMut(git_credentials::helper::Action) ->
pub struct Connection<'a, 'repo, T, P> {
pub(crate) remote: &'a Remote<'repo>,
pub(crate) authenticate: Option<AuthenticateFn<'a>>,
pub(crate) transport_config: Option<Box<dyn std::any::Any>>,
pub(crate) transport_options: Option<Box<dyn std::any::Any>>,
pub(crate) transport: T,
pub(crate) progress: P,
}
Expand Down
6 changes: 3 additions & 3 deletions git-repository/src/remote/connection/ref_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ where
}
};

if self.transport_config.is_none() {
self.transport_config =
if self.transport_options.is_none() {
self.transport_options =
self.remote
.repo
.transport_options(url.as_ref())
Expand All @@ -170,7 +170,7 @@ where
url: url.into_owned(),
})?;
}
if let Some(config) = self.transport_config.as_ref() {
if let Some(config) = self.transport_options.as_ref() {
self.transport.configure(&**config)?;
}
let mut outcome =
Expand Down

0 comments on commit e93768b

Please sign in to comment.