summaryrefslogtreecommitdiff
path: root/src/transport.c
Commit message (Collapse)AuthorAgeFilesLines
* path: separate git-specific path functions from utilEdward Thomson2021-11-091-3/+3
| | | | | | Introduce `git_fs_path`, which operates on generic filesystem paths. `git_path` will be kept for only git-specific path functionality (for example, checking for `.git` in a path).
* str: introduce `git_str` for internal, `git_buf` is externalethomson/gitstrEdward Thomson2021-10-171-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* transport: use GIT_ASSERTEdward Thomson2020-11-271-3/+3
|
* git_error: use new names in internal APIs and usageEdward Thomson2019-01-221-3/+3
| | | | | Move to the `git_error` name in the internal API for error-related functions.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-2/+2
|
* Make sure to always include "common.h" firstPatrick Steinhardt2017-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | Next to including several files, our "common.h" header also declares various macros which are then used throughout the project. As such, we have to make sure to always include this file first in all implementation files. Otherwise, we might encounter problems or even silent behavioural differences due to macros or defines not being defined as they should be. So in fact, our header and implementation files should make sure to always include "common.h" first. This commit does so by establishing a common include pattern. Header files inside of "src" will now always include "common.h" as its first other file, separated by a newline from all the other includes to make it stand out as special. There are two cases for the implementation files. If they do have a matching header file, they will always include this one first, leading to "common.h" being transitively included as first file. If they do not have a matching header file, they instead include "common.h" as first file themselves. This fixes the outlined problems and will become our standard practice for header and source files inside of the "src/" from now on.
* giterr_set: consistent error messagesEdward Thomson2016-12-291-1/+1
| | | | | | | | Error messages should be sentence fragments, and therefore: 1. Should not begin with a capital letter, 2. Should not conclude with punctuation, and 3. Should not end a sentence and begin a new one
* Merge pull request #3869 from richardipsum/fix-outdated-commentEdward Thomson2016-08-041-3/+3
|\ | | | | Fix outdated comment
| * Make comment conform to style guideRichard Ipsum2016-07-231-1/+2
| | | | | | | | Style guide says // style comments should be avoided.
| * Fix outdated commentRichard Ipsum2016-07-231-2/+1
| | | | | | | | SSH transport seems to be supported now.
* | remove conditions that prevent use of custom TLS streamwildart2016-07-061-2/+0
|/
* TabsChris Bargren2015-12-281-2/+2
|
* Handle git+ssh:// and ssh+git:// protocols supportChris Bargren2015-12-221-0/+2
|
* Rename GIT_SSL to GIT_OPENSSLCarlos Martín Nieto2015-04-231-1/+1
| | | | | This is what it's meant all along, but now we actually have multiple implementations, it's clearer to use the name of the library.
* Add a SecureTransport TLS channelCarlos Martín Nieto2015-04-231-1/+1
| | | | | As an alternative to OpenSSL when we're on OS X. This one can actually take advantage of stacking the streams.
* Add a custom param to git_smart_subtransport_definitionLeo Yang2015-03-181-3/+3
| | | | | The smart transport has already take the payload param. For the sub transport a payload param is useful for the implementer.
* remote: delete git_remote_supported_url()cmn/remove-supported-urlCarlos Martín Nieto2014-10-241-9/+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.
* remote: get rid of git_remote_valid_url()Carlos Martín Nieto2014-08-311-13/+2
| | | | | | | | | 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.
* transport: return ENOTFOUND for HTTPS and SSH when they're not supportedCarlos Martín Nieto2014-08-311-0/+6
| | | | | | | The previous commit makes it harder to figure out if the library was built with support for a particular transport. Roll back some of the changes and remove ssh:// and https:// from the list if we're being built without support for them.
* transport: distinguish between unknown and unsupported transportsCarlos Martín Nieto2014-08-311-24/+1
| | | | | | | | | | | | | Even when built without a SSH support, we know about this transport. It is implemented, but the current code makes us return an error message saying it's not. This is a leftover from the initial implementation of the transports when there were in fact transports we knew about but were not implemented. Instead, let the SSH transport itself say it cannot run, the same as we do for HTTPS.
* Allow to override default ssh transport_cbSven Strickroth2014-08-261-20/+26
| | | | | | W/o this patch it is not possible to have a third party ssh transport_cb if GIT_SSH is disabled or a third party transport_cb which has a higher priority than the default one. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Custom transport: minor cleanupsEdward Thomson2014-08-141-62/+86
| | | | | | | | | | | | * Move the transport registration mechanisms into a new header under 'sys/' because this is advanced stuff. * Remove the 'priority' argument from the registration as it adds unnecessary complexity. (Since transports cannot decline to operate, only the highest priority transport is ever executed.) Users who require per-priority transports can implement that in their custom transport themselves. * Simplify registration further by taking a scheme (eg "http") instead of a prefix (eg "http://").
* Improvements to git_transport extensibilityPhilip Kelley2014-06-261-2/+3
| | | | | 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
* 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.
* 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 compilation on Windows when using libssh2.mgbowen2013-12-051-5/+2
|
* Add git_transport_register, git_transport_unregisterPhilip Kelley2013-10-011-0/+66
|
* Make SSH APIs present even without SSH supportRussell Belfer2013-07-091-2/+2
| | | | | | The SSH APIs will just return an error code and state that the library was built without SSH support if they are called in that case.
* Fixed compilation issues when libssh2 is missingBrad Morgan2013-05-071-2/+11
|
* Added support for ssh:// urlsBrad Morgan2013-05-051-7/+8
|
* Adding ssh transport logicBrad Morgan2013-05-031-3/+3
|
* Added ssh transport fileBrad Morgan2013-05-031-2/+4
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Fix comment so it doesn't go over 100 charsJameson Miller2012-12-131-4/+6
|
* Transport resolution on Win32 should handle absolute local pathsJameson Miller2012-12-131-9/+24
|
* Push! By schu, phkelley, and congyiwu, et alPhilip Kelley2012-11-281-3/+4
|
* Reorganize transport architecture (squashed 3)Philip Kelley2012-11-011-31/+60
|
* http: add https support when GnuTLS is availableCarlos Martín Nieto2012-05-191-1/+1
| | | | | | | | If it's not available, an error saying so will be returned when trying to use a https:// URL. This also unifies a lot of the network code to use git_transport in many places instead of an socket descriptor.
* errors: Rename the generic return codesVicent Martí2012-05-181-3/+3
|
* Remove old and unused error codesVicent Martí2012-05-021-2/+4
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-021-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * error-handling: remote, transportCarlos Martín Nieto2012-04-111-4/+4
| |
* | Merge branch 'ssh-urls' into developmentCarlos Martín Nieto2012-03-051-7/+17
|\ \ | |/ |/|
| * Make git_remote_supported_url() public and shorten error stringCarlos Martín Nieto2012-03-051-2/+1
| |
| * introduced new function: git_remote_supported_url() <-- returns true if this ↵Ryan Wilcox2012-03-011-0/+6
| | | | | | | | version of libgit2 supports the correct transport mechanism for a URL or path
| * fix up previous SSH path parsing commit based on @carlosmn feedbackRyan Wilcox2012-03-011-26/+9
| |
| * implement support for username@host:path URLs in transport_find_fn()Ryan Wilcox2012-02-291-3/+25
| |
* | Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-2/+2
|/ | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* transport: prevent the transport determination mechanism from segfaulting ↵nulltoken2012-01-171-1/+1
| | | | when being passed an url starting with an unknown prefix