diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-25 17:05:27 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-06-26 22:58:39 +0200 |
| commit | e26b08d32c627efcbf7ab01a7296de89acc168fd (patch) | |
| tree | da007649d889b054b6f90846e78894fec04aaa54 /tests/online/push.c | |
| parent | ccb85c8fa146585e9e329ec7abfa00555b03dce2 (diff) | |
| download | libgit2-e26b08d32c627efcbf7ab01a7296de89acc168fd.tar.gz | |
ssh: adjust clone and push test credentials to the split user+pass method
For urls where we do not specify a username, we must handle the case
where the ssh transport asks us for the username.
Test also that switching username fails.
Diffstat (limited to 'tests/online/push.c')
| -rw-r--r-- | tests/online/push.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/online/push.c b/tests/online/push.c index 6da27bb96..50419efd4 100644 --- a/tests/online/push.c +++ b/tests/online/push.c @@ -50,6 +50,15 @@ static int cred_acquire_cb( GIT_UNUSED(user_from_url); GIT_UNUSED(payload); + if (GIT_CREDTYPE_USERNAME & allowed_types) { + if (!_remote_user) { + printf("GITTEST_REMOTE_USER must be set\n"); + return -1; + } + + return git_cred_username_new(cred, _remote_user); + } + if (GIT_CREDTYPE_DEFAULT & allowed_types) { if (!_remote_default) { printf("GITTEST_REMOTE_DEFAULT must be set to use NTLM/Negotiate credentials\n"); |
