MCPcopy Create free account
hub / github.com/archlinux/alpm / warmup_ssh_session

Function warmup_ssh_session

dev-scripts/src/sync/pkgsrc.rs:184–194  ·  view source on GitHub ↗

Create a new ssh connection that doesn't get bound to a given session. This allows that session to be reused, effectively eliminating the need to authenticate every time a git repository is cloned/pulled. This is especially necessary for users that have their SSH key on a physical device, such as a NitroKey, as authentications with such devices are sequential and take quite some time.

()

Source from the content-addressed store, hash-verified

182/// This is especially necessary for users that have their SSH key on a physical device, such as a
183/// NitroKey, as authentications with such devices are sequential and take quite some time.
184pub fn warmup_ssh_session() -> Result<(), Error> {
185 let mut ssh_command = Command::new("ssh");
186 ssh_command.args(vec!["-T", SSH_HOST]);
187 trace!("Running command: {ssh_command:?}");
188 let output = &ssh_command.output().map_err(|source| Error::Io {
189 context: "running the SSH warmup command".to_string(),
190 source,
191 })?;
192
193 ensure_success(output, "Failed to run ssh warmup command".to_string())
194}
195
196/// Update a local git repository to the newest state.
197/// Resets any local changes in case in each repository beforehand to prevent any conflicts.

Callers 1

Calls 1

ensure_successFunction · 0.85

Tested by

no test coverage detected