summaryrefslogtreecommitdiff
path: root/tests/online/clone.c
Commit message (Collapse)AuthorAgeFilesLines
* clone: set the credentials callback during testingcmn/push-testsCarlos Martín Nieto2015-06-121-0/+1
|
* test: Add a test for in-memory SSH private key cred_cbMichał Górny2015-05-271-0/+68
|
* remote: remove live changing of refspecsCarlos Martín Nieto2015-05-131-8/+1
| | | | | | | | | | | | The base refspecs changing can be a cause of confusion as to what is the current base refspec set and complicate saving the remote's configuration. Change `git_remote_add_{fetch,push}()` to update the configuration instead of an instance. This finally makes `git_remote_save()` a no-op, it will be removed in a later commit.
* remote: move the transport ctor to the callbacksCarlos Martín Nieto2015-05-131-4/+4
| | | | | | | Instead of having it set in a different place from every other callback, put it the main structure. This removes some state from the remote and makes it behave more like clone, where the constructors are passed via the options.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-36/+25
| | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* Add failing test for cert callback with non-ecrypted streamCarlos Martín Nieto2015-03-161-0/+7
| | | | | | When we have an HTTP stream and have set the certificatre check callback, we currently fail as we ask the unencrypted stream for its certificate.
* clone: drop now unnecessary SAFE_CREATEEdward Thomson2015-02-271-1/+1
|
* remote: rename _load() to _lookup()cmn/remote-lookupCarlos Martín Nieto2014-11-081-2/+2
| | | | This brings it in line with the rest of the lookup functions.
* Add tests for host namesSven Strickroth2014-10-091-2/+4
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Provide host name to certificate_check_cbSven Strickroth2014-09-221-3/+6
| | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* ssh: skip the localhost cert check earliercmn/host-cert-infoCarlos Martín Nieto2014-09-161-2/+4
| | | | | Skip it before we attempt to clone, as we would exit with -1 on systems which do not have sshd running.
* ssh: expose both hashesCarlos Martín Nieto2014-09-161-4/+13
| | | | | The user may have the data hashed as MD5 or SHA-1, so we should provide both types for consumption.
* ssh: provide our own types for host key lengthsCarlos Martín Nieto2014-09-161-0/+2
| | | | | Instead of using the libssh2 defines, provide our own, which eases usage as we do not need to check whether libgit2 was built with libssh2 or not.
* net: use only structs to pass information about certCarlos Martín Nieto2014-09-161-13/+8
| | | | | | Instead of spreading the data in function arguments, some of which aren't used for ssh and having a struct only for ssh, use a struct for both, using a common parent to pass to the callback.
* Merge remote-tracking branch 'upstream/master' into cmn/host-cert-infoCarlos Martín Nieto2014-09-161-0/+9
|\
| * Skip SSH clone tests if libgit2 not built with GIT_SSH definedLinquize2014-09-011-0/+9
| |
* | ssh: add test for host keyCarlos Martín Nieto2014-09-161-0/+32
| | | | | | | | | | Test that the certificate check callback gets the right fingerprint from the host we're connecting to.
* | winhttp: credential check on successful connectCarlos Martín Nieto2014-09-161-2/+4
| | | | | | | | On successful connection, still ask the user whether they accept the server's certificate, indicating that WinHTTP would let it though.
* | Bring certificate check back to the normal return codeCarlos Martín Nieto2014-09-161-2/+2
| | | | | | | | | | Returning 0 lets the certificate check succeed. An error code is bubbled up to the user.
* | ssh: do ssh cert info before asking for credentialsCarlos Martín Nieto2014-09-161-0/+3
| | | | | | | | | | We know the host's key as soon as we connect, so we should perform the check as soon as we can, before we bother with the user's credentials.
* | transport: always call the certificate check callbackCarlos Martín Nieto2014-09-161-5/+7
| | | | | | | | | | | | | | We should let the user decide whether to cancel the connection or not regardless of whether our checks have decided that the certificate is fine. We provide our own assessment to the callback to let the user fall back to our checks if they so desire.
* | remote: add tests for the certificate callbackCarlos Martín Nieto2014-09-161-0/+35
|/
* winhttp: Prevent swallowing of url parsing errornulltoken2014-08-271-0/+6
|
* Adjust clone tests to USERNAME cred typeCarlos Martín Nieto2014-08-271-0/+3
|
* Merge remote-tracking branch 'upstream/master' into cmn/ssh-retryCarlos Martín Nieto2014-08-271-52/+119
|\
| * online::clone::credentials support default credentialsEdward Thomson2014-08-151-3/+26
| |
| * Don't run the ssh clone tests against http remotesEdward Thomson2014-08-141-1/+1
| |
| * ssh: provide a factory function for setting ssh pathscmn/ssh-factory-for-pathsCarlos Martín Nieto2014-07-071-0/+65
| | | | | | | | | | | | | | | | | | git allows you to set which paths to use for the git server programs when connecting over ssh; and we want to provide something similar. We do this by providing a factory function which can be set as the remote's transport callback which will set the given paths upon creation.
| * clone: remote git_clone_into{,_local} from the public APIcmn/clone-custom-repoCarlos Martín Nieto2014-07-021-40/+22
| | | | | | | | | | | | As git_clone now has callbacks to configure the details of the repository and remote, remove the lower-level functions from the public API, as they lack some of the logic from git_clone proper.
| * test: remove assembla clone testcmn/clone-auth-changeCarlos Martín Nieto2014-06-131-6/+0
| | | | | | | | | | | | | | The assembla failure we were seeing referred to a private repository, which is not what is there at the moment. This reverts 1fd21b0342f
| * test: use read-only accountCarlos Martín Nieto2014-06-131-3/+3
| | | | | | | | | | | | Don't write in plaintext the password of an account which has full control over the repository. Instead use an account with read-only access.
* | ssh: adjust clone and push test credentials to the split user+pass methodCarlos Martín Nieto2014-06-261-1/+29
| | | | | | | | | | | | | | 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.
* | ssh: make sure to ask for a username and use the same oneCarlos Martín Nieto2014-06-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to know which authentication methods are supported/allowed by the ssh server, we need to send a NONE auth request, which needs a username associated with it. Most ssh server implementations do not allow switching the username between authentication attempts, which means we cannot use a dummy username and then switch. There are two ways around this. The first is to use a different connection, which an earlier commit implements, but this increases how long it takes to get set up, and without knowing the right username, we cannot guarantee that the list we get in response is the right one. The second is what's implemented here: if there is no username specified in the url, ask for it first. We can then ask for the list of auth methods and use the user's credentials in the same connection.
* | ssh: request credentials again on authentication failureCarlos Martín Nieto2014-06-261-0/+31
| | | | | | | | | | Instead of completely giving up on the first failure, ask for credentials as long as we fail to authenticate.
* | ssh: propagate the error code from the auth callbackCarlos Martín Nieto2014-06-171-2/+1
| | | | | | | | We need to be able to get a GIT_EUSER back through the outermost call.
* | ssh: detect authentication methodsCarlos Martín Nieto2014-06-171-0/+15
|/ | | | | | | | Before calling the credentials callback, ask the sever which authentication methods it supports and report that to the user, instead of simply reporting everything that the transport supports. In case of an error, we do fall back to listing all of them.
* Win32: Fix failing clone_mirror testPhilip Kelley2014-06-071-0/+3
|
* clone: add failing test for a mirror-clone with clone_intoCarlos Martín Nieto2014-05-191-0/+33
| | | | | Show a failure to perform a mirror-clone from a repository, both local and remote.
* Clar: skip testsvmg/clar-skip-testVicent Marti2014-04-021-9/+2
|
* git_checkout_opts -> git_checkout_optionsBen Straub2014-03-061-2/+2
|
* Only run clone-failure test on private repoBen Straub2014-02-051-1/+7
|
* Fix broken clone testBen Straub2014-02-051-12/+4
|
* Augment clone API with reflog parametersBen Straub2014-01-301-1/+1
|
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Fix warningsRussell Belfer2013-11-181-0/+2
|
* Propagate auth error codes as GIT_EUSER in winhttpEdward Thomson2013-11-181-0/+33
|
* Rename tests-clar to testsBen Straub2013-11-141-0/+256