Skip to content

Commit 8ca0e92

Browse files
JMLX42alexcrichton
authored andcommitted
Add the ssh_key_from_memory optional feature. (#331)
* Add the ssh_key_from_memory optional feature. * Enable the ssh_key_from_memory feature by default. Users with older versions of libssh can still disable it if needed.
1 parent 6259a36 commit 8ca0e92

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ thread-id = "3.3.0" # remove when we work with minimal-versions without it
4141

4242
[features]
4343
unstable = []
44-
default = ["ssh", "https", "curl"]
44+
default = ["ssh", "https", "curl", "ssh_key_from_memory"]
4545
ssh = ["libgit2-sys/ssh"]
4646
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
4747
curl = ["libgit2-sys/curl"]
48+
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]
4849

4950
[workspace]
5051
members = ["systest", "git2-curl"]

libgit2-sys/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ openssl-sys = { version = "0.9", optional = true }
3333
ssh = ["libssh2-sys"]
3434
https = ["openssl-sys"]
3535
curl = ["curl-sys"]
36+
ssh_key_from_memory = []

libgit2-sys/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ fn main() {
4848
let msvc = target.contains("msvc");
4949
let mut cfg = cmake::Config::new("libgit2");
5050

51+
#[cfg(feature = "ssh_key_from_memory")]
52+
cfg.define("GIT_SSH_MEMORY_CREDENTIALS", "1");
53+
5154
if msvc {
5255
// libgit2 passes the /GL flag to enable whole program optimization, but
5356
// this requires that the /LTCG flag is passed to the linker later on,

0 commit comments

Comments
 (0)