diff options
author | David Calavera <david.calavera@gmail.com> | 2015-03-19 14:57:15 -0700 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-05-27 20:36:53 +0200 |
commit | 08e6b875c11e71b27154d4fb0d36d56ac40aba33 (patch) | |
tree | 858e6b5356897e4735b4126744183563a9d7b1b8 /src | |
parent | 7a8b85032f4390b6b14e55e0074d864fe742ca3b (diff) | |
download | libgit2-08e6b875c11e71b27154d4fb0d36d56ac40aba33.tar.gz |
Return an error when ssh memory credentials are not supported.
To not modify the external api.
Diffstat (limited to 'src')
-rw-r--r-- | src/transports/cred.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/transports/cred.c b/src/transports/cred.c index 68007fb95..c1f305d77 100644 --- a/src/transports/cred.c +++ b/src/transports/cred.c @@ -195,7 +195,6 @@ int git_cred_ssh_key_new( GIT_CREDTYPE_SSH_KEY); } -#ifdef GIT_SSH_MEMORY_CREDENTIALS int git_cred_ssh_key_memory_new( git_cred **cred, const char *username, @@ -203,6 +202,7 @@ int git_cred_ssh_key_memory_new( const char *privatekey, const char *passphrase) { +#ifdef GIT_SSH_MEMORY_CREDENTIALS return git_cred_ssh_key_type_new( cred, username, @@ -210,8 +210,12 @@ int git_cred_ssh_key_memory_new( privatekey, passphrase, GIT_CREDTYPE_SSH_MEMORY); -} +#else + giterr_set(GITERR_INVALID, + "This version of libgit2 was not built with ssh memory credentials."); + return -1; #endif +} static int git_cred_ssh_key_type_new( git_cred **cred, |