summaryrefslogtreecommitdiff
path: root/src/pack-objects.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2334 from libgit2/rb/fix-2333Russell Belfer2014-05-121-0/+1
|\ | | | | Be more careful with user-supplied buffers
| * Be more careful with user-supplied buffersrb/fix-2333Russell Belfer2014-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | This adds in missing calls to `git_buf_sanitize` and fixes a number of places where `git_buf` APIs could inadvertently write NUL terminator bytes into invalid buffers. This also changes the behavior of `git_buf_sanitize` to NUL terminate a buffer if it can and of `git_buf_shorten` to do nothing if it can. Adds tests of filtering code with zeroed (i.e. unsanitized) buffer which was previously triggering a segfault.
* | Merge pull request #2188 from libgit2/cmn/config-snapshotRussell Belfer2014-05-121-2/+4
|\ \ | |/ |/| 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-3/+8
| | | | | | | | | | This way we can assume we have a consistent view of the config situation when we're looking up remote, branch, pack-objects, etc.
* | pack-objects: always write out the status in write_one()cmn/pack-objects-memoryCarlos Martín Nieto2014-04-261-0/+1
| | | | | | | | Make sure we set the output parameter to a value.
* | Don't redefine the same callback types, their signatures may changeJacques Germishuys2014-04-211-1/+1
|/
* pack-objects: free memory safelyCarlos Martín Nieto2014-03-041-10/+17
| | | | | | | | | A few fixes have accumulated in this area which have made the freeing of data a bit muddy. Make sure to free the data only when needed and once. When we are going to write a delta to the packfile, we need to free the data, otherwise leave it. The current version of the code mixes up the checks for po->data and po->delta_data.
* Reorganize zstream API and fix wrap problemsRussell Belfer2014-01-301-11/+6
| | | | | | | | There were some confusing issues mixing up the number of bytes written to the zstream output buffer with the number of bytes consumed from the zstream input. This reorganizes the zstream API and makes it easier to deflate an arbitrarily large input while still using a fixed size output.
* Some fixes for Windows x64 warningsRussell Belfer2014-01-301-1/+1
|
* Fix write_object.XTao2014-01-261-3/+5
|
* Packbuilder contains its own zstreamEdward Thomson2014-01-141-5/+4
|
* Packbuilder stream deflate instead of one-shotEdward Thomson2014-01-141-64/+81
|
* Refactor zlib for easier deflate streamingEdward Thomson2014-01-141-3/+3
|
* Fix up some valgrind leaks and warningsRussell Belfer2013-12-111-1/+12
|
* One more rename/cleanup for callback err functionsRussell Belfer2013-12-111-1/+1
|
* Some callback error check style cleanupsRussell Belfer2013-12-111-2/+5
| | | | I find this easier to read...
* Remove converting user error to GIT_EUSERRussell Belfer2013-12-111-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-22/+25
| | | | | | | | | | | | | 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.
* Fix warningsLinquize2013-11-121-1/+1
|
* Allow callers to set mode on packfile creationEdward Thomson2013-11-071-1/+2
|
* Add git_packbuilder_hash to query pack filenameEdward Thomson2013-11-071-2/+10
|
* Merge pull request #1933 from libgit2/vmg/gcc-warningsRussell Belfer2013-11-011-2/+2
|\ | | | | Warnings for Windows x64 (MSVC) and GCC on Linux
| * Fix warning on win64Linquize2013-11-011-2/+2
| |
* | Merge pull request #1918 from libgit2/cmn/indexer-namingVicent Martí2013-11-011-7/+7
|\ \ | |/ |/| indexer: remove the stream infix
| * indexer: remove the stream infixCarlos Martín Nieto2013-10-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | 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.
* | pack-objects: Depth can be negativeVicent Marti2013-10-301-4/+3
|/
* Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí2013-10-281-36/+2
|\ | | | | Add support for thin packs
| * indexer: fix thin packsCarlos Martín Nieto2013-10-041-1/+1
| | | | | | | | | | | | When given an ODB from which to read objects, the indexer will attempt to inject the missing bases at the end of the pack and update the header and trailer to reflect the new contents.
| * pack: move the object header function hereCarlos Martín Nieto2013-10-041-35/+1
| |
* | Support cancellation in push operationJameson Miller2013-10-021-19/+24
|/ | | | | | | | | | | | | | | | This commit adds cancellation for the push operation. This work consists of: 1) Support cancellation during push operation - During object counting phase - During network transfer phase - Propagate GIT_EUSER error code out to caller 2) Improve cancellation support during fetch - Handle cancellation request during network transfer phase - Clear error string when cancelled during indexing 3) Fix error handling in git_smart__download_pack Cancellation during push is still only handled in the pack building and network transfer stages of push (and not during packbuilding).
* Initial Implementation of progress reports during pushJameson Miller2013-09-301-0/+30
| | | | | | | | | | | | | | | | | | | | | | This adds the basics of progress reporting during push. While progress for all aspects of a push operation are not reported with this change, it lays the foundation to add these later. Push progress reporting can be improved in the future - and consumers of the API should just get more accurate information at that point. The main areas where this is lacking are: 1) packbuilding progress: does not report progress during deltafication, as this involves coordinating progress from multiple threads. 2) network progress: reports progress as objects and bytes are going to be written to the subtransport (instead of as client gets confirmation that they have been received by the server) and leaves out some of the bytes that are transfered as part of the push protocol. Basically, this reports the pack bytes that are written to the subtransport. It does not report the bytes sent on the wire that are received by the server. This should be a good estimate of progress (and an improvement over no progress).
* pack: fix memory leak in error pathRémi Duraffort2013-07-151-1/+3
|
* Mutex init can failRussell Belfer2013-05-311-0/+3
| | | | | | | It is obviously quite a serious problem if this happens, but mutex initialization can fail and we should detect it. It's a bit like a memory allocation failure, in that you're probably pretty screwed if this occurs, but at least we'll catch it.
* packbuilder: also write index in git_packbuilder_writeMichael Schubert2013-05-271-22/+36
| | | | | | git_packbuilder_write() used to write a packfile to the passed file path. Instead, ask for a destination directory and create both the packfile and an index, as most users probably do expect.
* Fixes indentationXavier L2013-04-231-8/+8
|
* Added function to insert commit into packXavier L2013-04-231-0/+15
|
* indexer: use a hashtable for keeping track of offsetsCarlos Martín Nieto2013-03-031-2/+0
| | | | | | | | | | These offsets are needed for REF_DELTA objects, which encode which object they use as a base, but not where it lies in the packfile, so we need a list. These objects are mostly from older packfiles, before OFS_DELTA was widely spread. The time spent in indexing these packfiles is greatly reduced, though remains above what git is able to do.
* Add git_push_options, to set packbuilder parallelismPhilip Kelley2013-02-111-0/+7
|
* A simple perf optimization in pack-objects.cPhilip Kelley2013-01-221-13/+16
|
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Always check the result of git_mutex_lockJustin Spahr-Summers2012-12-091-4/+14
|
* Push! By schu, phkelley, and congyiwu, et alPhilip Kelley2012-11-281-12/+4
|
* Fix warnings on Win64 buildRussell Belfer2012-11-271-12/+13
|
* API review / update for tree.hRussell Belfer2012-11-271-1/+1
|
* Rename ref and reflog apis for consistencyBen Straub2012-11-271-1/+2
|
* Merge pull request #1016 from arrbee/fix-checkout-dir-removalVicent Martí2012-11-131-6/+6
|\ | | | | Update checkout with new strategies & behavior
| * Fix warnings and valgrind issuesRussell Belfer2012-11-091-6/+6
| | | | | | | | | | This fixes some various warnings that showed up in Travis and a couple uses of uninitialized memory and one memory leak.
* | Remove git_hash_ctx_new - callers now _ctx_init()Edward Thomson2012-11-131-11/+9
| |
* | Win32 CryptoAPI and CNG support for SHA1Edward Thomson2012-11-131-12/+13
|/