We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
write_temporary_ssh_key()
1 parent 85423ec commit 7f182b4Copy full SHA for 7f182b4
src/git.rs
@@ -50,6 +50,17 @@ impl Credentials {
50
}
51
52
53
+ /// Write the SSH key to a temporary file and return the path. The file is
54
+ /// deleted once the returned path is dropped.
55
+ ///
56
+ /// Note: On Linux this function creates the temporary file in `/dev/shm` to
57
+ /// avoid writing it to disk.
58
59
+ /// # Errors
60
61
+ /// - If non-SSH credentials are use, `Err` is returned.
62
+ /// - If creation of the temporary file fails, `Err` is returned.
63
64
pub fn write_temporary_ssh_key(&self) -> Result<tempfile::TempPath, PerformError> {
65
let key = match self {
66
Credentials::Ssh { key } => key,
0 commit comments