tests/network/remote


Log

Author Commit Date CI Message
Edward Thomson 55a7117d 2020-10-11T13:55:44 remote: use git_remote_name_is_valid
Edward Thomson 51eff5a5 2020-05-29T13:13:19 strarray: we should `dispose` instead of `free` 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.
Etienne Samson 39d18fe6 2019-07-31T08:37:10 smart: use push_glob instead of manual filtering 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.
Erik Aigner 59647e1a 2019-04-08T15:54:25 remote: add callback to resolve URLs before connecting 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.
Edward Thomson f673e232 2018-12-27T13:47:34 git_error: use new names in internal APIs and usage Move to the `git_error` name in the internal API for error-related functions.
Etienne Samson 10fa2dd6 2018-06-20T02:26:50 tests: consolidate all remote creation tests in one test suite
Etienne Samson 798be87e 2018-06-20T02:26:49 tests: rename remote creation test suite
Patrick Steinhardt ecf4f33a 2018-02-08T11:14:48 Convert usage of `git_buf_free` to new `git_buf_dispose`
Patrick Steinhardt bee423cc 2017-06-13T10:29:23 tests: network: add missing include for `git_repository_new` 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.
Edward Thomson fe9a5dd3 2017-06-12T12:00:14 remote: ensure we can create an anon remote on inmemory repo Given a wholly in-memory repository, ensure that we can create an anonymous remote and perform actions on it.
Patrick Steinhardt fe345c73 2016-02-09T12:29:31 Remove unused static functions
Carlos Martín Nieto 07bd3e57 2015-05-07T12:57:56 proxy: ask the user for credentials if necessary
Matt Burke 4f2b6093 2015-09-08T13:53:41 Tell the git_transport about the custom_headers
Carlos Martín Nieto c6e942fb 2015-05-17T15:19:22 remote: validate refspecs before adding to config 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.
Carlos Martín Nieto ae5b9362 2015-05-17T15:11:45 remote: remove fetch parameter from create_anonymous An anonymous remote is not configured and cannot therefore have configured refspecs. Remove the parameter which adds this from the constructor.
Carlos Martín Nieto 041ad7db 2015-05-14T10:34:05 push: add tests for the push negotiation callback The functionality was meged without including tests, so let's add them now.
Carlos Martín Nieto 0bc3d56d 2015-05-07T16:12:36 tests: don't push to our resources 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.
Carlos Martín Nieto a4b6452a 2015-04-23T06:55:29 remote: remove git_remote_save() It has now become a no-op, so remove the function and all references to it.
Carlos Martín Nieto 77254990 2015-04-23T06:51:34 remote: remove live changing of refspecs 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.
Carlos Martín Nieto 35a8a8c5 2015-04-22T17:29:20 remote: move the tagopt setting to the fetch options This is another option which we should not be keeping in the remote, but is specific to each particular operation.
Carlos Martín Nieto 3eff2a57 2015-04-22T16:11:10 remote: move the update_fetchhead setting to the options 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.
Carlos Martín Nieto 058b753c 2015-04-22T15:45:21 remote: move the transport ctor to the callbacks 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.
Carlos Martín Nieto 22261344 2015-04-22T04:38:08 remote: remove url and pushurl from the save logic 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.
Carlos Martín Nieto 8f0104ec 2015-04-21T22:10:36 Remove the callbacks struct from the remote 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.
cthomas fc6f044e 2015-04-21T20:02:24 Fix for Issue #3023 tests fail with no network 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
Carlos Martín Nieto 9a97f49e 2014-12-21T15:31:03 config: borrow refcounted references 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.
Carlos Martín Nieto 4e498646 2015-01-15T16:50:31 repository: remove log message override for switching the active branch 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.
Carlos Martín Nieto 412a3808 2015-01-15T15:31:23 push: remove reflog message override We always use "update by push".
Carlos Martín Nieto 659cf202 2015-01-07T12:23:05 Remove the signature from ref-modifying functions 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.
Carlos Martín Nieto fe794b2e 2014-12-16T08:57:05 remote: remove git_push from the public API Instead we provide git_remote_upload() and git_remote_update_tips() in order to have a parallel API for fetching and pushing.
Carlos Martín Nieto d524b2d3 2014-12-10T17:23:33 push: fold unpack_ok() into finish() The push cannot be successful if we sent a bad packfile. We should return an error in that case instead of storing it elsewhere.
Linquize d226fbf1 2014-12-07T22:42:06 Fix broken test suite on Windows
Carlos Martín Nieto 3fade40e 2014-11-23T21:29:35 remote: add test for pushing and deleting with the local transport
Carlos Martín Nieto f7fcb18f 2014-11-23T14:12:54 Plug leaks Valgrind is now clean except for libssl and libgcrypt.
Edward Thomson 8b5b814e 2014-11-17T20:10:58 Merge pull request #2671 from swisspol/remote_create_fix Fixed active_refspecs field not initialized on new git_remote objects
Edward Thomson 7f1b73b7 2014-11-17T17:03:55 Merge pull request #2693 from libgit2/cmn/push-refspec-refactor push: use the common refspec parser
Pierre-Olivier Latour d3cd7da5 2014-10-28T20:56:18 Fixed active_refspecs field not initialized on new git_remote objects 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.
Carlos Martín Nieto aad638f3 2014-11-07T15:00:11 push: use the common refspec parser 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.
Pierre-Olivier Latour e284c451 2014-10-28T22:18:38 Changed GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0
Edward Thomson 02bc5233 2014-11-08T17:05:13 Merge pull request #2698 from libgit2/cmn/fetchhead-refactor Refactor fetchhead
Carlos Martín Nieto 64fdd86d 2014-11-08T20:21:14 remote: don't check for upstream on an anonymous remote 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.
Carlos Martín Nieto 209425ce 2014-11-08T13:25:51 remote: rename _load() to _lookup() This brings it in line with the rest of the lookup functions.
Edward Thomson f890a84f 2014-11-06T10:19:22 Merge pull request #2682 from libgit2/cmn/fetch-tags-refspec remote: check for the validity of the refspec when updating FETCH_HEAD
Edward Thomson cce27d82 2014-11-03T14:07:20 git_remote_rename: propogate GIT_ENOTFOUND
Carlos Martín Nieto ea8dedc9 2014-11-02T20:39:29 remote: fix tagopt test 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.
Carlos Martín Nieto 0f838d27 2014-11-02T20:03:23 remote: add a failing test for checking the current branch's upstream 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.
Edward Thomson 725cd5f2 2014-10-24T16:44:07 Merge pull request #2646 from libgit2/cmn/remote-rename remote: accept a repo and name for renaming
Carlos Martín Nieto 46c8f7f8 2014-10-24T16:25:59 remote: accept a repo and name for renaming 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.
Carlos Martín Nieto 0862f617 2014-10-24T12:19:13 remote: delete git_remote_supported_url() 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.
Edward Thomson a6ed1fcb 2014-10-10T12:21:28 Merge pull request #2593 from libgit2/cmn/remote-delete-name remote: accept a repository and remote name for deletion
Carlos Martín Nieto 262eec23 2014-09-30T16:07:30 remote: accept a repository and remote name for deletion 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.
Carlos Martín Nieto c5837cad 2014-07-04T09:03:33 remote: implement opportunistic remote-tracking branch updates 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.
Carlos Martín Nieto 9c206a22 2014-06-06T15:24:53 remote: use active refspec override in the tests This lets us test this bit as well as getting closer to what they were trying to do.
Carlos Martín Nieto 3f894205 2014-06-06T15:01:45 remote: allow overriding the refspecs for download and fetch 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.
Carlos Martín Nieto 25abbc27 2014-09-17T03:19:40 Clean up some leaks in the test suite
Vicent Marti 31e752b6 2014-09-09T12:52:36 Merge pull request #2511 from libgit2/cmn/remote-default-restrict Restrict which refs can be the default branch
Carlos Martín Nieto 15c30b72 2014-09-02T13:23:54 clone: handle overly restrictive refspecs 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`.
Carlos Martín Nieto e128a1af 2014-09-02T13:10:19 clone: correct handling of an unborn HEAD 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.
Carlos Martín Nieto 538f9081 2014-09-01T16:35:10 remote: add test for single-branch clone When cloning, we may be asking for a particular branch or subset of branches. Make sure we test for that.
Carlos Martín Nieto f2ffab61 2014-09-01T15:59:36 remote: add tests for remote-branch edge cases 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.
Carlos Martín Nieto 05ac7051 2014-08-31T21:53:42 remote: test for supported URLs in a single place 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.
Carlos Martín Nieto ba67c075 2014-08-31T17:16:40 remote: get rid of git_remote_valid_url() 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.
Carlos Martín Nieto 94412b00 2014-08-10T17:48:12 remote: assert what we want to happen when ther is no default branch Assert what we already do, so as to notice changes.
Jacques Germishuys dc8adda4 2014-08-15T22:51:19 git_remote_ls() should return an error if the transport is not available
Philip Kelley 1697cd6f 2014-06-25T13:20:27 Improvements to git_transport extensibility 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
Carlos Martín Nieto 231f350d 2014-06-06T22:55:34 remote: don't free the remote on delete This was a bad idea. Don't free except in the free function.
Carlos Martín Nieto eb6aa791 2014-06-06T22:01:35 remote: failing test for renaming with a symref
Carlos Martín Nieto 72bca13e 2014-06-06T16:33:54 remote: return problem refspecs instead of using a callback There is no reason why we need to use a callback here. A string array fits better with the usage, as this is not an event and we don't need anything from the user.
Carlos Martín Nieto fe3b9d07 2014-06-06T00:54:11 remote: failing test for rename When there is a reference in the target namespace, we should overwrite it. Instead it gets a different name under the current code.
Arthur Schreiber d723dbed 2014-05-30T19:26:49 Remote: Set an error when a remote cannot be found. Inside `git_remote_load`, the calls to `get_optional_config` use `giterr_clear` to unset any errors that are set due to missing config keys. If neither a fetch nor a push url config was found for a remote, we should set an error again.
Carlos Martín Nieto d22db24f 2014-05-21T09:32:35 remote: add api to guess the remote's default branch If the remote supports the symref protocol extension, then we return that, otherwise we guess with git's rules.
Carlos Martín Nieto ec8a949a 2014-04-30T09:20:03 remote: remove remote-tracking branches on delete When we delete a remote, we also need to go through its fetch refspecs and remove the references they create locally.
nulltoken 40e48ea4 2013-11-15T15:36:37 remote: Introduce git_remote_delete()
Carlos Martín Nieto fd536d29 2014-03-26T11:15:57 remote: rename inmemory to anonymous and swap url and fetch order The order in this function is the opposite to what create_with_fetchspec() has, so change this one, as url-then-refspec is what git does. As we need to break compilation and the swap doesn't do that, let's take this opportunity to rename in-memory remotes to anonymous as that's really what sets them apart.
Ben Straub db55bb73 2014-02-06T11:18:10 Correct default reflog message for git_remote_fetch
Ben Straub c3ab1e5a 2014-02-04T20:38:13 Add reflog parameters to remote apis Also added a test for git_remote_fetch.
Edward Thomson 96f12e70 2014-01-29T12:50:42 Don't strcmp a git_buf, strcmp its char *
Vicent Marti 46e7fc18 2014-01-27T09:36:24 Merge pull request #2077 from libgit2/cmn/buf-out Buff up returning strings
Carlos Martín Nieto 66d585c6 2014-01-27T04:58:23 MSVC doesn't like modern code
Carlos Martín Nieto bf522e08 2014-01-26T16:59:36 refspec: move to git_buf for outputting strings
Arthur Schreiber 991b2840 2014-01-26T19:35:02 Make sure git_remote_dup copies a remote's refspecs correctly.
Graham Dennis c7015424 2014-01-18T08:54:19 Fix a compile warning.
Graham Dennis 194d077c 2014-01-18T08:43:29 Add test for pushing to a local file:// URL.
Arthur Schreiber 40ef47dd 2014-01-14T21:03:01 Add `git_remote_dup`.
Ben Straub 17820381 2013-11-14T14:05:52 Rename tests-clar to tests