summaryrefslogtreecommitdiff
path: root/tests/network
Commit message (Collapse)AuthorAgeFilesLines
* Tell the git_transport about the custom_headersMatt Burke2015-09-083-10/+10
|
* remote: add failing test for a mirror refspecCarlos Martín Nieto2015-08-111-5/+34
| | | | | | While we download the remote's remote-tracking branches, we don't download the tag. This points to the tag auto-follow rules interfering with the refspec.
* Fix memory leak in tests/network/refspecs.cJeff Hostetler2015-06-171-0/+2
|
* Merge pull request #3149 from libgit2/cmn/upstream-matching-pushEdward Thomson2015-05-281-0/+10
|\ | | | | Fill the pointers for matching refspecs
| * refspec: make sure matching refspecs have src, dst and input stringsCarlos Martín Nieto2015-05-221-0/+10
| | | | | | | | | | | | | | | | When we find out that we're dealing with a matching refspec, we set the flag and return immediately. This leaves the strings as NULL, which breaks the contract. Assign these pointers to a string with the correct values.
* | 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-133-69/+18
| | | | | | | | | | | | 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-132-10/+19
| | | | | | 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-134-108/+72
| | | | | | | | | | | | | | 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-035-53/+42
| | | | | | | | | | 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.
* Fix more indentation.David Calavera2015-01-071-1/+1
|
* Fix intentation.David Calavera2015-01-051-1/+1
|
* Load prune configuration when a remote is created.David Calavera2015-01-051-0/+44
|
* Merge pull request #2761 from libgit2/cmn/fetch-pruneEdward Thomson2014-12-301-0/+285
|\ | | | | Remote-tracking branch prunning
| * fetch: plug leaks in the prune testsCarlos Martín Nieto2014-12-141-18/+34
| |
| * fetch: remove the prune setterCarlos Martín Nieto2014-12-141-4/+2
| | | | | | | | | | | | | | | | This option does not get persisted to disk, which makes it different from the rest of the setters. Remove it until we go all the way. We still respect the configuration option, and it's still possible to perform a one-time prune by calling the function.
| * fetch: add test for the other order of overlapping specsCarlos Martín Nieto2014-12-141-0/+9
| |
| * fetch: assert we don't call update tips when there are no upatesCarlos Martín Nieto2014-12-141-0/+12
| | | | | | | | | | | | | | | | | | This is hiding a bug in the prune code, whereby we prune references we shouldn't but don't notice it in the code afterwards because update_tips() recreates them. This means that we do perform changes to the references (and get rid of the reflogs) when we shouldn't.
| * fetch: do set prune when testingCarlos Martín Nieto2014-12-141-0/+1
| | | | | | | | | | We load the remote again, so we need to ask the new remote to prune the refs, or we're not exercising the code in our tests.
| * Make sure that `fetch --prune --tags` doesn't remove tags.David Calavera2014-12-141-0/+59
| |
| * Cleanup repository after prune tests.David Calavera2014-12-141-19/+14
| |
| * Cleanup after testing remote prune.David Calavera2014-12-141-3/+6
| |
| * Fix references to git_remote_lookup.David Calavera2014-12-141-6/+6
| |
| * Test that prune overlapping works as expected.David Calavera2014-12-141-0/+64
| |
| * Fix calls to `git_remote_download` and `git_remote_fetch`.David Calavera2014-12-141-6/+6
| |
| * Add test for prune refsLinquize2014-12-141-0/+128
| |
* | Merge pull request #2762 from libgit2/cmn/hide-pushEdward Thomson2014-12-302-26/+23
|\ \ | | | | | | remote: remove git_push from the public API
| * | 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.
* | local: add failing test for sideband informationCarlos Martín Nieto2014-12-161-0/+34
|/ | | | | | We do not currently generate any messages when we're counting the objects, as might be expected from a local upload-pack. Assert that we do call the function when working.
* 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