Skip to content

Commit 7f182b4

Browse files
committed
git: Add doc comment to write_temporary_ssh_key()
1 parent 85423ec commit 7f182b4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/git.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ impl Credentials {
5050
}
5151
}
5252

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+
///
5364
pub fn write_temporary_ssh_key(&self) -> Result<tempfile::TempPath, PerformError> {
5465
let key = match self {
5566
Credentials::Ssh { key } => key,

0 commit comments

Comments
 (0)