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.
()
| 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. |
| 184 | pub 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. |
no test coverage detected