Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl<'repo> Remote<'repo> {
}

/// Check whether the remote is connected
pub fn connected(&mut self) -> bool {
pub fn connected(&self) -> bool {
unsafe { raw::git_remote_connected(self.raw) == 1 }
}

Expand Down Expand Up @@ -759,7 +759,7 @@ impl<'cb> Binding for PushOptions<'cb> {

impl<'repo, 'connection, 'cb> RemoteConnection<'repo, 'connection, 'cb> {
/// Check whether the remote is (still) connected
pub fn connected(&mut self) -> bool {
pub fn connected(&self) -> bool {
self.remote.connected()
}

Expand Down Expand Up @@ -884,13 +884,13 @@ mod tests {
origin.disconnect().unwrap();

{
let mut connection = origin.connect_auth(Direction::Push, None, None).unwrap();
let connection = origin.connect_auth(Direction::Push, None, None).unwrap();
assert!(connection.connected());
}
assert!(!origin.connected());

{
let mut connection = origin.connect_auth(Direction::Fetch, None, None).unwrap();
let connection = origin.connect_auth(Direction::Fetch, None, None).unwrap();
assert!(connection.connected());
}
assert!(!origin.connected());
Expand Down Expand Up @@ -1021,7 +1021,7 @@ mod tests {
let mut origin = repo.remote("origin", &url).unwrap();

{
let mut connection = origin
let connection = origin
.connect_auth(Direction::Fetch, Some(callbacks), None)
.unwrap();
assert!(connection.connected());
Expand Down
Loading