summaryrefslogtreecommitdiff
path: root/tests/network/remote
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | remote: allow overriding the refspecs for download and fetchCarlos Martín Nieto2014-09-301-9/+9
|/ | | | | | | With opportunistic ref updates, git has introduced the concept of having base refspecs *and* refspecs that are active for a particular fetch. Let's start by letting the user override the refspecs for download.
* Clean up some leaks in the test suiteCarlos Martín Nieto2014-09-171-0/+1
|
* Merge pull request #2511 from libgit2/cmn/remote-default-restrictVicent Marti2014-09-092-0/+108
|\ | | | | Restrict which refs can be the default branch
| * clone: handle overly restrictive refspecscmn/remote-default-restrictCarlos Martín Nieto2014-09-021-12/+1
| | | | | | | | | | | | | | | | | | | | | | When the fetch refspec does not include the remote's default branch, it indicates an error in user expectations or programmer error. Error out in that case. This lets us get rid of the dummy refspec which can never work as its zeroed out. In the cases where we did not find a default branch, we set HEAD detached immediately, which lets us refactor the "normal" path, removing `found_branch`.
| * clone: correct handling of an unborn HEADCarlos Martín Nieto2014-09-021-0/+15
| | | | | | | | | | If the remote does not advertise HEAD, then it is unborn and we cannot checkout that branch. Handle it the same way as an empty repo.
| * remote: add test for single-branch cloneCarlos Martín Nieto2014-09-021-0/+61
| | | | | | | | | | When cloning, we may be asking for a particular branch or subset of branches. Make sure we test for that.
| * remote: add tests for remote-branch edge casesCarlos Martín Nieto2014-09-021-0/+29
| | | | | | | | | | | | Add tests for the case when there are no branches on the remote and when HEAD is detached but has the id of a non-branch. In both of these cases, we should return ENOTFOUND.
| * remote: assert what we want to happen when ther is no default branchCarlos Martín Nieto2014-08-291-0/+14
| | | | | | | | Assert what we already do, so as to notice changes.
* | remote: test for supported URLs in a single placeCarlos Martín Nieto2014-08-311-16/+9
| | | | | | | | | | Instead of using ifdefs to run the tests, use them to set when we expect to support a particular scheme and always have the tests in the code.
* | remote: get rid of git_remote_valid_url()Carlos Martín Nieto2014-08-311-11/+16
|/ | | | | | | | | It does the same as git_remote_supported_url() but has a name which implies we'd check the URL for correctness while we're simply looking at the scheme and looking it up in our lists. While here, fix up the tests so we check all the combination of what's supported.
* git_remote_ls() should return an error if the transport is not availableJacques Germishuys2014-08-151-0/+11
|
* Improvements to git_transport extensibilityPhilip Kelley2014-06-261-26/+4
| | | | | git_remote_set_transport now takes a transport factory rather than a transport git_clone_options now allows the caller to specify a remote creation callback