summaryrefslogtreecommitdiff
path: root/tests/network/remote
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'main' into better-compatiblity-for-at-time-notationYoichi Nakayama2021-11-231-2/+2
|\ | | | | | | | | Conflicts: src/revparse.c
| * tests: declare functions statically where appropriateEdward Thomson2021-11-111-2/+2
| |
* | Add a branch with a empty reflog into testrepo.gitYoichi Nakayama2021-10-221-3/+3
|/
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-173-30/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | libgit2 has two distinct requirements that were previously solved by `git_buf`. We require: 1. A general purpose string class that provides a number of utility APIs for manipulating data (eg, concatenating, truncating, etc). 2. A structure that we can use to return strings to callers that they can take ownership of. By using a single class (`git_buf`) for both of these purposes, we have confused the API to the point that refactorings are difficult and reasoning about correctness is also difficult. Move the utility class `git_buf` to be called `git_str`: this represents its general purpose, as an internal string buffer class. The name also is an homage to Junio Hamano ("gitstr"). The public API remains `git_buf`, and has a much smaller footprint. It is generally only used as an "out" param with strict requirements that follow the documentation. (Exceptions exist for some legacy APIs to avoid breaking callers unnecessarily.) Utility functions exist to convert a user-specified `git_buf` to a `git_str` so that we can call internal functions, then converting it back again.
* remote: deprecate resolve_url callbackethomson/custom_urlEdward Thomson2021-08-291-0/+8
| | | | | | | Using a callback to set a resolve_url is not particularly idiomatic. Deprecate it in favor of the `set_instance_url` and `set_instance_pushurl` functions which can now be called from the `git_remote_ready_cb` callback.
* remote: introduce git_remote_ready_cbEdward Thomson2021-08-291-0/+42
| | | | Introduce a new callback that fires when the remote is ready to connect.
* remote: introduce set_instance_urlEdward Thomson2021-08-271-0/+45
| | | | | | Users may want to override the URL on a particular instance of a remote, instead of updating the configuration. Previously, users could use a callback to do this, but this is not particularly idiomatic.
* remote: use git_remote_name_is_validEdward Thomson2020-10-251-8/+15
|
* strarray: we should `dispose` instead of `free`Edward Thomson2020-06-012-18/+18
| | | | | | We _dispose_ the contents of objects; we _free_ objects (and their contents). Update `git_strarray_free` to be `git_strarray_dispose`. `git_strarray_free` remains as a deprecated proxy function.
* smart: use push_glob instead of manual filteringEtienne Samson2019-08-211-3/+3
| | | | | | | | | | The code worked under the assumption that anything under `refs/tags` are tag objects, and all the rest would be peelable to a commit. As it is completely valid to have tags to blobs under a non `refs/tags` ref, this would cause failures when trying to peel a tag to a commit. Fix the broken filtering by switching to `git_revwalk_push_glob`, which already handles this case.
* 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