takes care of `~/` paths, defaults to `$HOME/.ssh/id_rsa` and resolves symlinks.
(identity: Option<PathBuf>)
| 141 | |
| 142 | /// takes care of `~/` paths, defaults to `$HOME/.ssh/id_rsa` and resolves symlinks. |
| 143 | fn get_private_key_path(identity: Option<PathBuf>) -> Result<PathBuf> { |
| 144 | let private_key = identity.unwrap_or(home()?.join(".ssh/id_rsa")); |
| 145 | |
| 146 | canonicalize_path(&private_key).context("private key path was incorrect") |
| 147 | } |
| 148 | |
| 149 | fn git_ssh_credentials_callback<'a>(identity: Option<PathBuf>) -> Result<RemoteCallbacks<'a>> { |
| 150 | let private_key = get_private_key_path(identity)?; |
no test coverage detected