summaryrefslogtreecommitdiff
path: root/tests/network/remote
Commit message (Collapse)AuthorAgeFilesLines
* remote: add callback to resolve URLs before connectingErik Aigner2019-05-211-8/+77
| | | | | | Since libssh2 doesn't read host configuration from the config file, this callback can be used to hand over URL resolving to the client without touching the SSH implementation itself.
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-4/+4
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* tests: consolidate all remote creation tests in one test suiteEtienne Samson2018-11-021-59/+0
|
* tests: rename remote creation test suiteEtienne Samson2018-11-021-37/+0
|
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-103-4/+4
|
* tests: network: add missing include for `git_repository_new`Patrick Steinhardt2017-06-131-0/+1
| | | | | | | A newly added test uses the `git_repository_new` function without the corresponding header file being included. While this works due to the compiler deducing the correct function signature, we should obviously just include the function's declaration file.
* remote: ensure we can create an anon remote on inmemory repoethomson/config_for_inmemory_repoEdward Thomson2017-06-121-0/+16
| | | | | Given a wholly in-memory repository, ensure that we can create an anonymous remote and perform actions on it.
* Remove unused static functionsPatrick Steinhardt2016-06-211-10/+0
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-193-10/+10
|
* Tell the git_transport about the custom_headersMatt Burke2015-09-083-10/+10
|
* remote: validate refspecs before adding to configCarlos Martín Nieto2015-05-281-0/+2
| | | | | | | When we moved from acting on the instance to acting on the configuration, we dropped the validation of the passed refspec, which can lead to writing an invalid refspec to the configuration. Bring that validation back.
* remote: remove fetch parameter from create_anonymousCarlos Martín Nieto2015-05-282-16/+6
| | | | | | An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
* push: add tests for the push negotiation callbackCarlos Martín Nieto2015-05-141-0/+114
| | | | | The functionality was meged without including tests, so let's add them now.
* tests: don't push to our resourcescmn/local-push-messageCarlos Martín Nieto2015-05-131-2/+2
| | | | | | | | | A couple of tests use the wrong remote to push to. We did not notice up to now because the local push would copy individual objects, and those already existed, so it became a no-op. Once we made local push create the packfile, it became noticeable that there was a new packfile where it didn't belong.
* remote: remove git_remote_save()Carlos Martín Nieto2015-05-131-12/+0
| | | | | It has now become a no-op, so remove the function and all references to it.
* remote: remove live changing of refspecsCarlos Martín Nieto2015-05-132-61/+17
| | | | | | | | | | | | 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 tagopt setting to the fetch optionsCarlos Martín Nieto2015-05-132-20/+15
| | | | | This is another option which we should not be keeping in the remote, but is specific to each particular operation.
* remote: move the update_fetchhead setting to the optionsCarlos Martín Nieto2015-05-131-3/+3
| | | | | | While this will rarely be different from the default, having it in the remote adds yet another setting it has to keep around and can affect its behaviour. Move it to the options.
* remote: move the transport ctor to the callbacksCarlos Martín Nieto2015-05-131-3/+3
| | | | | | | 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.
* remote: remove url and pushurl from the save logicCarlos Martín Nieto2015-05-131-8/+17
| | | | | | As a first step in removing the repository-saving logic, don't allow chaning the url or push url from a remote object, but change the configuration on the configuration immediately.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-133-35/+28
| | | | | | | | | | | | | | 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.
* Fix for Issue #3023 tests fail with no networkcthomas2015-04-211-51/+0
| | | | | | | Moved offending tests from network to online so they will get skipped when there is a lack of network connectivity: -test_online_remotes__single_branch -test_online_remotes__restricted_refspecs
* config: borrow refcounted referencescmn/config-borrow-entryCarlos Martín Nieto2015-03-031-12/+4
| | | | | | | | | | | | | | | This changes the get_entry() method to return a refcounted version of the config entry, which you have to free when you're done. This allows us to avoid freeing the memory in which the entry is stored on a refresh, which may happen at any time for a live config. For this reason, get_string() has been forbidden on live configs and a new function get_string_buf() has been added, which stores the string in a git_buf which the user then owns. The functions which parse the string value takea advantage of the borrowing to parse safely and then release the entry.
* repository: remove log message override for switching the active branchCarlos Martín Nieto2015-03-031-3/+3
| | | | | | We want to use the "checkout: moving from ..." message in order to let git know when a change of branch has happened. Make the convenience functions for this goal write this message.
* push: remove reflog message overrideCarlos Martín Nieto2015-03-031-2/+2
| | | | We always use "update by push".
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-034-35/+24
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* remote: remove git_push from the public APIcmn/hide-pushCarlos Martín Nieto2014-12-302-26/+23
| | | | | Instead we provide git_remote_upload() and git_remote_update_tips() in order to have a parallel API for fetching and pushing.
* push: fold unpack_ok() into finish()Carlos Martín Nieto2014-12-101-4/+0
| | | | | The push cannot be successful if we sent a bad packfile. We should return an error in that case instead of storing it elsewhere.
* Fix broken test suite on WindowsLinquize2014-12-071-3/+2
|
* remote: add test for pushing and deleting with the local transportCarlos Martín Nieto2014-11-231-0/+34
|
* Plug leaksCarlos Martín Nieto2014-11-231-0/+2
| | | | Valgrind is now clean except for libssl and libgcrypt.
* Merge pull request #2671 from swisspol/remote_create_fixEdward Thomson2014-11-171-0/+35
|\ | | | | Fixed active_refspecs field not initialized on new git_remote objects
| * Fixed active_refspecs field not initialized on new git_remote objectsPierre-Olivier Latour2014-11-171-0/+35
| | | | | | | | | | | | | | | | | | When creating a new remote, contrary to loading one from disk, active_refspecs was not populated. This means that if using the new remote to push, git_push_update_tips() will be a no-op since it checks the refspecs passed during the push against the base ones i.e. active_refspecs. And therefore the local refs won't be created or updated after the push operation.
* | Merge pull request #2693 from libgit2/cmn/push-refspec-refactorEdward Thomson2014-11-171-3/+3
|\ \ | |/ |/| push: use the common refspec parser
| * push: use the common refspec parsercmn/push-refspec-refactorCarlos Martín Nieto2014-11-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | There is one well-known and well-tested parser which we should use, instead of implementing parsing a second time. The common parser is also augmented to copy the LHS into the RHS if the latter is empty. The expressions test had to change a bit, as we now catch a bad RHS of a refspec locally.
* | Changed GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0Pierre-Olivier Latour2014-11-091-1/+1
| |
* | Merge pull request #2698 from libgit2/cmn/fetchhead-refactorEdward Thomson2014-11-081-0/+10
|\ \ | | | | | | Refactor fetchhead
| * | remote: don't check for upstream on an anonymous remoteCarlos Martín Nieto2014-11-081-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | If the remote is anonymous, then we cannot check for any configuration, as there is no name. Check for this before we try to use the name, which may be a NULL pointer. This fixes #2697.
* | | remote: rename _load() to _lookup()cmn/remote-lookupCarlos Martín Nieto2014-11-083-17/+17
|/ / | | | | | | This brings it in line with the rest of the lookup functions.
* | Merge pull request #2682 from libgit2/cmn/fetch-tags-refspecEdward Thomson2014-11-061-0/+27
|\ \ | |/ |/| remote: check for the validity of the refspec when updating FETCH_HEAD
| * remote: add a failing test for checking the current branch's upstreamCarlos Martín Nieto2014-11-021-0/+27
| | | | | | | | | | | | | | | | | | | | When we update FETCH_HEAD we check whether the remote is the current branch's upstream remote. The code does not check whether the current refspec is relevant for this reference but always tries to perform the reverse transformation, which causes it to error out if the refspec doesn't match the reference. Thanks to Pierre-Olivier Latour for the reproduction recipe.
* | git_remote_rename: propogate GIT_ENOTFOUNDEdward Thomson2014-11-031-0/+9
| |
* | remote: fix tagopt testCarlos Martín Nieto2014-11-021-7/+7
|/ | | | | | | | | | | An anonymous remote wouldn't create remote-tracking branches, so testing we don't create them for TAGS_ALL is nonsensical. Furthermore, the name of the supposed remote-tracking branch was also not one which would have been created had it had a name. Give the remote a name and test that we only create the tags when we pass TAGS_ALL and that we do create the remote-branch branch when given TAGS_AUTO.
* Merge pull request #2646 from libgit2/cmn/remote-renameEdward Thomson2014-10-241-43/+21
|\ | | | | remote: accept a repo and name for renaming
| * remote: accept a repo and name for renamingcmn/remote-renameCarlos Martín Nieto2014-10-241-43/+21
| | | | | | | | | | | | | | | | | | | | Remote objects are not meant to be changed from under the user. We did this in rename, but only the name and left the refspecs, such that a save would save the wrong refspecs (and a fetch and anything else would use the wrong refspecs). Instead, let's simply take a name and not change any loaded remote from under the user.
* | remote: delete git_remote_supported_url()cmn/remove-supported-urlCarlos Martín Nieto2014-10-241-20/+0
|/ | | | | | | This function does not in fact tell us anything, as almost anything with a colon in it is a valid rsync-style SSH path; it can not tell us that we do not support ftp or afp or similar as those are still valid SSH paths and we do support that.
* Merge pull request #2593 from libgit2/cmn/remote-delete-nameEdward Thomson2014-10-101-18/+3
|\ | | | | remote: accept a repository and remote name for deletion
| * remote: accept a repository and remote name for deletioncmn/remote-delete-nameCarlos Martín Nieto2014-09-301-18/+3
| | | | | | | | | | | | | | | | We don't need the remote loaded, and the function extracted both of these from the git_remote in order to do its work, so let's remote a step and not ask for the loaded remote at all. This fixes #2390.
* | remote: implement opportunistic remote-tracking branch updatescmn/remote-fetch-refsCarlos Martín Nieto2014-09-301-0/+21
| | | | | | | | | | | | | | | | | | | | | | When a list of refspecs is passed to fetch (what git would consider refspec passed on the command-line), we not only need to perform the updates described in that refspec, but also update the remote-tracking branch of the fetched remote heads according to the remote's configured refspecs. These "fetches" are not however to be written to FETCH_HEAD as they would be duplicate data, and it's not what the user asked for.
* | remote: use active refspec override in the testsCarlos Martín Nieto2014-09-301-25/+66
| | | | | | | | | | This lets us test this bit as well as getting closer to what they were trying to do.