summaryrefslogtreecommitdiff
path: root/src/transports
Commit message (Collapse)AuthorAgeFilesLines
* ssh: libssh2_channel_write() behaves like send()cmn/ssh-send-everythingCarlos Martín Nieto2014-07-021-1/+12
| | | | | | | | | | When the stream writing function was written, it assume that libssh2_channel_write() would always write all of the data to the wire. This is only true for the first 32k of data, which it tries to fit into one ssh packet. Since it can perform short writes, call it in a loop like we do for send(), advancing the buffer offset.
* http: fix typo in credentials logicCarlos Martín Nieto2014-06-131-1/+1
| | | | | We want to check whether the credentials callback is NULL, not whether the payload is.
* clone: re-use the local transport's path resolutioncmn/path-to-pathCarlos Martín Nieto2014-06-031-20/+2
| | | | | | Whe already worked out the kinks with the function used in the local transport. Expose it and make use of it in the local clone method instead of trying to work it out again.
* smart: initialize the error variableCarlos Martín Nieto2014-05-221-1/+1
|
* Plug leaks and fix a C99-ismCarlos Martín Nieto2014-05-222-12/+14
| | | | | | | We have too many places where we repeat free code, so when adding the new free to the generic code, it didn't take for the local transport. While there, fix a C99-ism that sneaked through.
* Merge pull request #2376 from libgit2/cmn/remote-symrefVicent Marti2014-05-225-11/+120
|\ | | | | Add support for the symref extension
| * local transport: expose the symref dataCarlos Martín Nieto2014-05-211-4/+18
| | | | | | | | | | When using the local transport, we always have the symbolic information available, so fill it.
| * remote: expose the remote's symref mappingsCarlos Martín Nieto2014-05-212-0/+20
| | | | | | | | | | Add a symref_target field to git_remote_head to expose the symref mappings to the user.
| * smart: store reported symrefsCarlos Martín Nieto2014-05-213-7/+82
| | | | | | | | | | | | | | | | | | | | | | | | The protocol has a capability which allows the server to tell us which refs are symrefs, so we can e.g. know which is the default branch. This capability is different from the ones we already support, as it's not setting a flag to true, but requires us to store a list of refspec-formatted mappings. This commit does not yet expose the information in the reference listing.
* | smart: send a flush when we disconnectcmn/fetch-terminateCarlos Martín Nieto2014-05-201-0/+12
|/ | | | | The git server wants to hear a flush from us when we disconnect, particularly when we want to perform a fetch but are up to date.
* Merge pull request #2284 from jacquesg/push-progress-callbackVicent Marti2014-04-254-48/+51
|\ | | | | Fire progress and update tips callbacks also for pushes.
| * Correct argument order of git__calloc()Jacques Germishuys2014-04-211-1/+1
| |
| * Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-213-5/+5
| |
| * Rename progress callback to sideband_progressJacques Germishuys2014-04-211-2/+2
| |
| * Check the return codes of remote callbacks.Jacques Germishuys2014-04-211-5/+9
| | | | | | | | The user may have requested that the operation be cancelled.
| * Fire progress callbacks also for pushes.Jacques Germishuys2014-04-201-36/+35
| | | | | | | | | | It's not very useful to only know that a pre-receive hook has declined a push, you probably want to know why.
* | Merge pull request #2283 from phkelley/win32_fsVicent Marti2014-04-231-75/+50
|\ \ | | | | | | Win32: UTF-8 <-> WCHAR conversion overhaul
| * | Win32: UTF-8 <-> WCHAR conversion overhaulPhilip Kelley2014-04-191-75/+50
| |/
* | transports: allow the creds callback to say it doesn't existCarlos Martín Nieto2014-04-222-32/+55
|/ | | | | | | | Allow the credentials callback to return GIT_PASSTHROUGH to make the transports code behave as though none was set. This should make it easier for bindings to behave closer to the C code when there is no credentials callback set at their level.
* Only zero sensitive information on destruction (and memory actually ↵Jacques Germishuys2014-04-181-7/+21
| | | | allocated by us)
* Make git_cred_ssh_custom_new() naming more consistentJacques Germishuys2014-04-182-3/+3
|
* Introduce git_cred_ssh_interactive_new()Jacques Germishuys2014-04-182-0/+58
| | | | This allows for keyboard-interactive based SSH authentication
* cred: tighten username rulesCarlos Martín Nieto2014-04-182-50/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The ssh-specific credentials allow the username to be missing. The idea being that the ssh transport will then use the username provided in the url, if it's available. There are two main issues with this. The credential callback already knows what username was provided by the url and needs to figure out whether it wants to ask the user for it or it can reuse it, so passing NULL as the username means the credential callback is suspicious. The username provided in the url is not in fact used by the transport. The only time it even considers it is for the user/pass credential, which asserts the existence of a username in its constructor. For the ssh-specific ones, it passes in the username stored in the credential, which is NULL. The libssh2 macro we use runs strlen() against this value (which is no different from what we would be doing ourselves), so we then crash. As the documentation doesn't suggest to leave out the username, assert the need for a username in the code, which removes this buggy behavior and removes implicit state. git_cred_has_username() becomes a blacklist of credential types that do not have a username. The only one at the moment is the 'default' one, which is meant to call up some Microsoft magic.
* Seamless support for NTLM/Kerberos auth on WindowsPhilip Kelley2014-03-181-19/+102
|
* local transport: catch double-opensCarlos Martín Nieto2014-03-071-0/+3
| | | | | Combinations of connect + fetch can call local_open multiple times. Detect this and skip the initialization stage.
* - BUGFIX #2133 (@fourplusone) in smart_protocol.cMiha2014-02-252-1/+6
| | | | | | - added MSVC cmake definitions to disable warnings - general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows - some MSVC reported warning fixes
* Factor out code to convert local "url" into a path.Graham Dennis2014-01-191-20/+28
| | | Previously this code was shared between `local_push` and `local_connect`.
* Fix local push to file:// URL.Graham Dennis2014-01-181-1/+19
|
* 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.
* Cleanups, renames, and leak fixesRussell Belfer2013-12-121-1/+1
| | | | | | | | | 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.
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-115-67/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the behavior of callbacks so that the callback error code is not converted into GIT_EUSER and instead we propagate the return value through to the caller. Instead of using the giterr_capture and giterr_restore functions, we now rely on all functions to pass back the return value from a callback. To avoid having a return value with no error message, the user can call the public giterr_set_str or some such function to set an error message. There is a new helper 'giterr_set_callback' that functions can invoke after making a callback which ensures that some error message was set in case the callback did not set one. In places where the sign of the callback return value is meaningful (e.g. positive to skip, negative to abort), only the negative values are returned back to the caller, obviously, since the other values allow for continuing the loop. The hardest parts of this were in the checkout code where positive return values were overloaded as meaningful values for checkout. I fixed this by adding an output parameter to many of the internal checkout functions and removing the overload. This added some code, but it is probably a better implementation. There is some funkiness in the network code where user provided callbacks could be returning a positive or a negative value and we want to rely on that to cancel the loop. There are still a couple places where an user error might get turned into GIT_EUSER there, I think, though none exercised by the tests.
* Further EUSER and error propagation fixesRussell Belfer2013-12-112-13/+17
| | | | | | | | | | | | | This continues auditing all the places where GIT_EUSER is being returned and making sure to clear any existing error using the new giterr_user_cancel helper. As a result, places that relied on intercepting GIT_EUSER but having the old error preserved also needed to be cleaned up to correctly stash and then retrieve the actual error. Additionally, as I encountered places where error codes were not being propagated correctly, I tried to fix them up. A number of those fixes are included in the this commit as well.
* Add config read fns with controlled error behaviorRussell Belfer2013-12-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | This adds `git_config__lookup_entry` which will look up a key in a config and return either the entry or NULL if the key was not present. Optionally, it can either suppress all errors or can return them (although not finding the key is not an error for this function). Unlike other accessors, this does not normalize the config key string, so it must only be used when the key is known to be in normalized form (i.e. all lower-case before the first dot and after the last dot, with no invalid characters). This also adds three high-level helper functions to look up config values with no errors and a fallback value. The three functions are for string, bool, and int values, and will resort to the fallback value for any error that arises. They are: * `git_config__get_string_force` * `git_config__get_bool_force` * `git_config__get_int_force` None of them normalize the config `key` either, so they can only be used for internal cases where the key is known to be in normal format.
* Updates to cancellation logic during download and indexing of packfile.Jameson Miller2013-12-021-8/+22
|
* ssh: add support for ssh-agent authenticationAlessandro Ghedini2013-11-202-2/+74
|
* Introduce git_cred_default for NTLM/SPNEGO authEdward Thomson2013-11-182-0/+55
|
* Propagate auth error codes as GIT_EUSER in winhttpEdward Thomson2013-11-182-10/+12
|
* Merge pull request #1956 from libgit2/cmn/fetch-default-headVicent Martí2013-11-114-31/+52
|\ | | | | Remote revamp (director's cut)
| * remote: update head list on pushCarlos Martín Nieto2013-11-113-11/+27
| | | | | | | | | | A previous commit forgot to update the head list after push as well, leading to wrong output of git_remote_ls().
| * remote: make _ls return the list directlyCarlos Martín Nieto2013-11-114-21/+25
| | | | | | | | | | | | | | | | | | | | | | The callback-based method of listing remote references dates back to the beginning of the network code's lifetime, when we didn't know any better. We need to keep the list around for update_tips() after disconnect() so let's make use of this to simply give the user a pointer to the array so they can write straightforward code instead of having to go through a callback.
| * remote: store dwimed refspecs separatelyCarlos Martín Nieto2013-11-011-4/+4
| | | | | | | | | | This allows us to add e.g. "HEAD" as a refspec when none are given without overwriting the user's data.
| * remote: give up after 256 failures to find a common objectCarlos Martín Nieto2013-11-011-5/+6
| | | | | | | | | | | | | | This avoids sending our whole history bit by bit to the remote in cases where there is no common history, just to give up in the end. The number comes from the canonical implementation.
* | Merge pull request #1936 from libgit2/better-url-parsingVicent Martí2013-11-102-45/+33
|\ \ | | | | | | Streamline url-parsing logic.
| * | Fix ssh.c compileBen Straub2013-11-041-2/+3
| | |
| * | Use http_parser_parse_url to parse urlsBen Straub2013-11-042-43/+30
| |/
* | don't double free pktEdward Thomson2013-11-051-1/+1
|/
* Merge pull request #1918 from libgit2/cmn/indexer-namingVicent Martí2013-11-012-3/+3
|\ | | | | indexer: remove the stream infix
| * indexer: remove the stream infixCarlos Martín Nieto2013-10-302-3/+3
| | | | | | | | | | | | | | | | | | | | | | It was there to keep it apart from the one which read in from a file on disk. This other indexer does not exist anymore, so there is no need for anything other than git_indexer to refer to it. While here, rename _add() function to _append() and _finalize() to _commit(). The former change is cosmetic, while the latter avoids talking about "finalizing", which OO languages use to mean something completely different.
* | Prevent another segfault from bad URLBen Straub2013-10-311-5/+6
| |
* | Initialize variablesBen Straub2013-10-301-2/+2
| |