summaryrefslogtreecommitdiff
path: root/src/transports/local.c
Commit message (Collapse)AuthorAgeFilesLines
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-191-1/+4
|
* local: plug a leak in the progress reportingCarlos Martín Nieto2015-05-141-1/+5
|
* Merge pull request #3103 from libgit2/cmn/local-push-messageEdward Thomson2015-05-131-56/+22
|\ | | | | Use the packbuilder in local push
| * local: use the packbuilder to pushCarlos Martín Nieto2015-05-131-55/+18
| | | | | | | | | | | | | | | | Instead of copying each object individually, as we'd been doing, use the packbuilder which should be faster and give us some feedback. While performing this change, we can hook up the packbuilder's writing to the push progress so the caller knows how far along we are.
| * local: add clarification for non-bare push restrictionCarlos Martín Nieto2015-05-131-1/+4
| |
* | local: send the packbuilder progress via the sidebandCarlos Martín Nieto2015-05-131-0/+29
|/ | | | | Set a callback for the packbuilder so we can send the sideband messages to the caller, formatting them as git would.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-131-3/+5
| | | | | | | | | | | | | | 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.
* local: recusrively insert non-branch objects into the packfilecmn/clone-everythingCarlos Martín Nieto2015-03-171-1/+2
| | | | | | | | | When we insert e.g. a tag or tagged object into the packfile, we must make sure to insert any referenced objects as well, or we will have broken links. Use the recursive version of packfile insertion to make sure we send over not just the tagged object but also the objects it references.
* Merge pull request #2972 from libgit2/cmn/pack-objects-walkEdward Thomson2015-03-171-32/+10
|\ | | | | [WIP] Smarter pack-building
| * local: let the packbuilder perform smarter object insertioncmn/pack-objects-walkCarlos Martín Nieto2015-03-111-32/+10
| | | | | | | | | | | | | | | | | | | | Currently we use the most naïve and inefficient method for figuring out which objects to send to the remote whereby we end up trying to insert subdirs which have not changed multiple times. Instead, make use of the packbuilder's built-in more efficient method which uses the walk to feed the object list and avoids inserting an object and its descendants.
* | local: create pack with multiple threadscmn/local-pack-threadingCarlos Martín Nieto2015-03-111-0/+3
|/ | | | | | | | | | | | | The default behaviour for the packbuilder is to perform the work in a single thread, which is fine for the public API, but we currently have no way for a user to determine the number of threads to use when creating the packfile, which makes our clone behaviour over the filesystem quite a bit slower than what git offers. This is a very particular scenario, in which we avoid spawning git by being ourselves the server-side, so it's probably ok to auto-set the threading, as the upload-pack process would do if we were talking to git.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-1/+1
| | | | | | | | | | 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.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-121-1/+1
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Plug some leaksJacques Germishuys2014-12-291-2/+9
|
* local: send 'counting objects' outputcmn/local-proto-progressCarlos Martín Nieto2014-12-161-0/+52
| | | | | Pretend we have a git process at the other end by creating a similar progress output when inserting objects into the packbuilder.
* local: adjust to the common refspec parsercmn/local-pushCarlos Martín Nieto2014-11-231-11/+6
| | | | | | | We no longer have NULL strings, but empty ones and duplicate the sides if necessar, so the first check will never do anything. While in the area, remove unnecessary ifs and early returns.
* Plug leaksCarlos Martín Nieto2014-11-231-6/+14
| | | | Valgrind is now clean except for libssl and libgcrypt.
* push: use the common refspec parsercmn/push-refspec-refactorCarlos Martín Nieto2014-11-091-2/+2
| | | | | | | | | | | 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.
* 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.
* Plug leaks and fix a C99-ismCarlos Martín Nieto2014-05-221-8/+11
| | | | | | | 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.
* 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.
* Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-2/+2
|
* 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.
* 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.
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-32/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* 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.
* remote: make _ls return the list directlyCarlos Martín Nieto2013-11-111-7/+3
| | | | | | | | | | | 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.
* indexer: remove the stream infixCarlos Martín Nieto2013-10-301-1/+1
| | | | | | | | | | | 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.
* remote: move the credentials callback to the structCarlos Martín Nieto2013-10-021-1/+1
| | | | | Move this one as well, letting us have a single way of setting the callbacks for the remote, and removing fields from the clone options.
* Provide better errors for push on non-bare local remotesBen Straub2013-09-041-1/+2
|
* odb: wrap the stream reading and writing functionsCarlos Martín Nieto2013-08-151-3/+3
| | | | | | This is in preparation for moving the hashing to the frontend, which requires us to handle the incoming data before passing it to the backend's stream.
* Make sure we don't leak memory again.Arthur Schreiber2013-06-251-0/+7
|
* Unbreak git_remote_ls on a local transport after disconnecting.Arthur Schreiber2013-06-251-12/+15
|
* Fix a leak in the local transport code.Arthur Schreiber2013-06-241-9/+9
|
* Fix trailing whitespacesnulltoken2013-05-151-1/+1
|
* Unify whitespaces to tabsLinquize2013-05-151-1/+1
|
* refs: remove the OID/SYMBOLIC filteringCarlos Martín Nieto2013-05-111-1/+1
| | | | | | | | | Nobody should ever be using anything other than ALL at this level, so remove the option altogether. As part of this, git_reference_foreach_glob is now implemented in the frontend using an iterator. Backends will later regain the ability of doing the glob filtering in the backend.
* Make git_oid_cmp public and add git_oid__cmpRussell Belfer2013-04-291-1/+1
|
* Allow git_remote_ls after disconnecting from the remoteCarlos Martín Nieto2013-04-151-12/+14
| | | | Keep the data around until free, as expected by our own fetch example
* Several warnings detected by static code analyzer fixedArkadiy Shapkin2013-03-181-1/+1
| | | | | | | Implicit type conversion argument of function to size_t type Suspicious sequence of types castings: size_t -> int -> size_t Consider reviewing the expression of the 'A = B == C' kind. The expression is calculated as following: 'A = (B == C)' Unsigned type is never < 0
* Implemented push on the local transportabepern2013-03-111-18/+218
|
* Fix fail clone local repository because can't found objectFrank Li2013-01-271-2/+5
| | | | | | avoid use object which is already free Signed-off-by: Frank Li <lznuaa@gmail.com>
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Cloning empty repos: only allow missing target for HEADBen Straub2012-12-151-2/+2
|
* Local Only ignore ENOTFOUNDs when adding corrupted refsBen Straub2012-12-141-4/+10
|
* Allow clone to handle empty reposBen Straub2012-12-141-1/+3
|
* Add a payload param to git_cred_acquire_cbBen Straub2012-12-101-0/+2
| | | Fixes #1128.
* Deploy versioned git_transport structureBen Straub2012-11-301-3/+2
|