summaryrefslogtreecommitdiff
path: root/src/remote.c
Commit message (Collapse)AuthorAgeFilesLines
* remote: accept a repository and remote name for deletioncmn/remote-delete-nameCarlos Martín Nieto2014-09-301-19/+5
| | | | | | | | 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.
* Merge remote-tracking branch 'upstream/master' into cmn/host-cert-infoCarlos Martín Nieto2014-09-161-2/+12
|\
| * Merge pull request #2554 from linquize/fetch-head-tagVicent Marti2014-09-151-2/+6
| |\ | | | | | | When auto follow tags, FETCH_HEAD should list only newly followed tags
| | * When auto follow tags, FETCH_HEAD should list only newly followed tagsLinquize2014-09-061-2/+6
| | |
| * | remote: short-circuit the default branch check if there is noneCarlos Martín Nieto2014-08-291-0/+3
| | | | | | | | | | | | | | | If we do not have a HEAD ref in the heads, we already know there is no default branch. Return immedately.
| * | remote: restrict default branch to branches namespaceCarlos Martín Nieto2014-08-291-0/+3
| |/
* | net: remove support for outright ignoring certificatesCarlos Martín Nieto2014-09-161-17/+3
| | | | | | | | | | | | | | | | | | | | This option make it easy to ignore anything about the server we're connecting to, which is bad security practice. This was necessary as we didn't use to expose detailed information about the certificate, but now that we do, we should get rid of this. If the user wants to ignore everything, they can still provide a callback which ignores all the information passed.
* | Provide a callback for certificate validationCarlos Martín Nieto2014-09-161-1/+2
|/ | | | | | | | | If the certificate validation fails (or always in the case of ssh), let the user decide whether to allow the connection. The data structure passed to the user is the native certificate information from the underlying implementation, namely OpenSSL or WinHTTP.
* git_remote_ls() should return an error if the transport is not availableJacques Germishuys2014-08-151-0/+7
|
* Improvements to git_transport extensibilityPhilip Kelley2014-06-261-8/+18
| | | | | 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
* remote: don't free the remote on deletecmn/remote-rename-moreCarlos Martín Nieto2014-06-061-2/+0
| | | | This was a bad idea. Don't free except in the free function.
* remote: handle symrefs when renamingCarlos Martín Nieto2014-06-061-10/+39
| | | | | | | A symref inside the namespace gets renamed, we should make it point to the target's new name. This is for the origin/HEAD -> origin/master type of situations.
* remote: return problem refspecs instead of using a callbackCarlos Martín Nieto2014-06-061-15/+25
| | | | | | 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.
* remote: make sure the name stays valid on renameCarlos Martín Nieto2014-06-061-3/+6
| | | | | | We must make sure that the name pointer remains valid, so make sure to allocate the new one before freeing the old one and swap them so the user never sees an invalid pointer.
* remote: remove rename code for anonymous remotesCarlos Martín Nieto2014-06-061-42/+11
| | | | | | | | We don't allow renames of anonymous remotes, so there's no need to handle them. A remote is always associated with a repository, so there's no need to check for that.
* remote: tighten up reference renamingcmn/remote-rename-fixesCarlos Martín Nieto2014-06-061-7/+9
| | | | | | | | Tighten up which references we consider for renaming so we don't try to rename unrelated ones and end up with unexplained references. If there is a reference on the target namespace, git overwrites it, so let's do the same.
* Merge pull request #2389 from ↵Vicent Marti2014-06-031-0/+1
|\ | | | | | | | | arthurschreiber/arthur/set-error-when-no-remote-found Remote: Set an error when a remote cannot be found.
| * Remote: Set an error when a remote cannot be found.Arthur Schreiber2014-05-301-0/+1
| | | | | | | | | | | | | | 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.
* | remote: build up the list of refs to removecmn/remote-deleteCarlos Martín Nieto2014-06-011-8/+34
|/ | | | | | When removing the remote-tracking branches, build up the list and remove in two steps, working around an issue with the iterator. Removing while we're iterating over the refs can cause us to miss references.
* remote: add api to guess the remote's default branchCarlos Martín Nieto2014-05-211-0/+47
| | | | | If the remote supports the symref protocol extension, then we return that, otherwise we guess with git's rules.
* Merge pull request #2313 from libgit2/cmn/remote-deleteVicent Marti2014-05-161-3/+145
|\ | | | | Remote deletion
| * remote: remove remote-tracking branches on deleteCarlos Martín Nieto2014-05-161-4/+54
| | | | | | | | | | When we delete a remote, we also need to go through its fetch refspecs and remove the references they create locally.
| * remote: move branch upstream deletion to use an iteratorCarlos Martín Nieto2014-04-301-57/+38
| | | | | | | | This should make it more readable and allocate a bunch fewer strings.
| * remote: Introduce git_remote_delete()nulltoken2014-04-301-3/+114
| |
* | Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-2/+3
|\ \ | | | | | | Configuration snapshotting
| * | repository: introduce a convenience config snapshot methodcmn/config-snapshotCarlos Martín Nieto2014-05-071-5/+2
| | | | | | | | | | | | | | | | | | Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
| * | Use config snapshottingCarlos Martín Nieto2014-04-181-2/+6
| | | | | | | | | | | | | | | This way we can assume we have a consistent view of the config situation when we're looking up remote, branch, pack-objects, etc.
* | | Fix remaining init_options inconsistenciesRussell Belfer2014-05-021-9/+4
| | | | | | | | | | | | | | | There were a couple of "init_opts()" functions a few more cases of structure initialization that I somehow missed.
* | | Check for NULL before passing it to vsnprintfJacques Germishuys2014-04-301-1/+1
| |/ |/|
* | Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-251-2/+2
|\ \ | | | | | | Fire progress and update tips callbacks also for pushes.
| * | Rename progress callback to sideband_progressJacques Germishuys2014-04-211-2/+2
| |/
* | remote: provide read access to the callback structureCarlos Martín Nieto2014-04-221-0/+7
|/ | | | | This should make it easier for bindings to dynamically override their own callbacks.
* Merge pull request #2215 from libgit2/rb/submodule-cache-fixesVicent Marti2014-04-041-51/+35
|\ | | | | Improve submodule cache management
| * Fix git_submodule_sync and add new config helperRussell Belfer2014-04-011-51/+35
| | | | | | | | | | | | | | | | | | | | | | | | This fixes `git_submodule_sync` to correctly update the remote URL of the default branch of the submodule along with the URL in the parent repository config (i.e. match core Git's behavior). Also move some useful helper logic from the submodule code into a shared config API `git_config__update_entry` that can either set or delete an entry with constraints like not overwriting or not creating a new entry. I used that helper to update a couple other places in the code.
* | remote: mark branch for-merge even if we're unbornCarlos Martín Nieto2014-04-021-7/+20
|/ | | | | | | | | | | When the current branch is unborn, git will still mark the current branch's upstream for-merge if there is an upstream configuration. The only non-constrived case is cloning from an empty repository which then gains history. origin's master should be marked for-merge. In order to do this, we cannot use the high-level wrappers that expect a reference, as we may not have one. Move over to the internal ones that expect a reference name, which we do have.
* remote: rename inmemory to anonymous and swap url and fetch orderCarlos Martín Nieto2014-04-011-4/+4
| | | | | | | | | | 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.
* Added function-based initializers for every options struct.Matthew Bowen2014-03-051-0/+12
| | | | The basic structure of each function is courtesy of arrbee.
* Fixed missing error check on call to git_remote_download in ↵Brian Lambert2014-03-051-2/+5
| | | | git_remote_fetch. Moved error check to statement following git_remote_disconnect so that the disconnect happens regardless of the result of the download call.
* Correct default reflog message for git_remote_fetchBen Straub2014-02-061-1/+12
|
* Add reflog parameters to remote apisBen Straub2014-02-041-7/+19
| | | Also added a test for git_remote_fetch.
* Ensure renaming a reference updates the reflogBen Straub2014-01-301-10/+18
|
* refspec: move to git_buf for outputting stringsCarlos Martín Nieto2014-01-271-2/+2
|
* Make sure git_remote_dup copies a remote's refspecs correctly.Arthur Schreiber2014-01-261-8/+26
|
* Add some missing const declarations.Arthur Schreiber2014-01-261-7/+7
|
* refs: remove the _with_log differentiationCarlos Martín Nieto2014-01-151-1/+1
| | | | | | Any well-behaved program should write a descriptive message to the reflog whenever it updates a reference. Let's make this more prominent by removing the version without the reflog parameters.
* We don't need memset here.Arthur Schreiber2014-01-141-2/+0
|
* Don't duplicate state that's only used when fetching.Arthur Schreiber2014-01-141-1/+0
|
* Add `git_remote_dup`.Arthur Schreiber2014-01-141-0/+41
|
* Cleanups, renames, and leak fixesRussell Belfer2013-12-121-2/+2
| | | | | | | | | This renames git_vector_free_all to the better git_vector_free_deep and also contains a couple of memory leak fixes based on valgrind checks. The fixes are specifically: failure to free global dir path variables when not compiled with threading on and failure to free filters from the filter registry that had not be initialized fully.
* One more rename/cleanup for callback err functionsRussell Belfer2013-12-111-1/+1
|