summaryrefslogtreecommitdiff
path: root/src/pack.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Make git_odb_foreach_cb take const paramRussell Belfer2012-11-271-1/+1
| | | | | This makes the first OID param of the ODB callback a const pointer and also propogates that change all the way to the backends.
* Set p->mwf.fd to -1 on errorSven Strickroth2012-11-241-2/+4
| | | | | | If p->mwf.fd is e.g. -2 then it is closed in packfile_free and an exception might be thrown. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Remove use of English expletivesMartin Woodward2012-11-231-1/+1
| | | | | | Remove words such as fuck, crap, shit etc. Remove other potentially offensive words from comments. Tidy up other geopolicital terms in comments.
* pack: iterate objects in offset orderDavid Michael Barr2012-09-141-12/+36
| | | | Compute the ordering on demand and persist until the index is freed.
* Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti2012-08-061-5/+6
|\ | | | | | | | | | | | | | | | | Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
| * Update iterators for consistency across libraryRussell Belfer2012-08-031-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates all the `foreach()` type functions across the library that take callbacks from the user to have a consistent behavior. The rules are: * A callback terminates the loop by returning any non-zero value * Once the callback returns non-zero, it will not be called again (i.e. the loop stops all iteration regardless of state) * If the callback returns non-zero, the parent fn returns GIT_EUSER * Although the parent returns GIT_EUSER, no error will be set in the library and `giterr_last()` will return NULL if called. This commit makes those changes across the library and adds tests for most of the iteration APIs to make sure that they follow the above rules.
* | portability: Improve x86/amd64 compatibilitynulltoken2012-07-241-3/+3
|/
* odb: add git_odb_foreach()Carlos Martín Nieto2012-07-031-0/+43
| | | | | Go through each backend and list every objects that exists in them. This allows fsck-like uses.
* mwindow: allow memory-window files to deregisterCarlos Martin Nieto2012-06-281-0/+1
| | | | | | | | | Once a file is registered, there is no way to deregister it, even after the structure that contains it is no longer needed and has been freed. This may be the source of #624. Allow and use the deregister function to remove our file from the global list.
* Actually do the mmap... unsurprisingly, this makes the indexer work on SFSChris Young2012-06-121-3/+3
| | | | | On RAM: the .idx and .pack files become links to a .lock and the original download respectively. Assume some feature (such as record locking) supported by SFS but not JXFS or RAM: is required.
* Basic mmap/munmap compatiblityChris Young2012-06-101-2/+2
|
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-7/+7
|
* errors: Rename the generic return codesVicent Martí2012-05-181-7/+7
|
* Fix valgrind issuesRussell Belfer2012-05-041-6/+19
| | | | | | | There are three changes here: - correctly propogate error code from failed object lookups - make zlib inflate use our allocators - add OID to notfound error in ODB lookups
* Merge pull request #632 from arrbee/win64-cleanupVicent Martí2012-04-231-2/+7
|\ | | | | Code clean up, including fixing warnings on Windows 64-bit build
| * Fix warnings on 64-bit windows buildsRussell Belfer2012-04-171-2/+7
| | | | | | | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
* | pack: signal a short buffer when neededCarlos Martín Nieto2012-04-131-11/+38
|/
* Convert attr, ignore, mwindow, status to new errorsRussell Belfer2012-03-161-1/+1
| | | | | Also cleaned up some previously converted code that still had little things to polish.
* Migrate ODB files to new error handlingRussell Belfer2012-03-121-145/+135
| | | | | | | | | | | | | | This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to the new style of error handling. Also got the unix and win32 versions of map.c. There are some minor changes to other files but no others were completely converted. This also contains an update to filebuf so that a zeroed out filebuf will not think that the fd (== 0) is actually open (and inadvertently call close() on fd 0 if cleaned up). Lastly, this was built and tested on win32 and contains a bunch of fixes for the win32 build which was pretty broken.
* error-handling: ReferencesVicent Martí2012-03-061-1/+1
| | | | | Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
* zlib: Remove custom `git2/zlib.h` headerVicent Martí2012-02-151-1/+1
| | | | | | This is legacy compat stuff for when `deflateBound` is not defined, but we're not embedding zlib and that function is always available. Kill that with fire.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Move path related functions from fileops to pathRussell Belfer2012-01-171-1/+1
| | | | | | | | | | | This takes all of the functions that look up simple data about paths (such as `git_futils_isdir`) and moves them over to path.h (becoming `git_path_isdir`). This leaves fileops.h just with functions that actually manipulate the filesystem or look at the file contents in some way. As part of this, the dir.h header which is really just for win32 support was moved into win32 (with some minor changes).
* Fix #534: 64-bit issues in WindowsVicent Martí2012-01-151-8/+1
| | | | | | | | | | | | off_t is always 32 bits in Windows, which is beyond stupid, but we just don't care anymore because we're using `git_off_t` which is assured to be 64 bits on all platforms, regardless of compilation mode. Just ensure that no casts to `off_t` are performed. Also, the check for `off_t` overflows has been dropped, once again, because the size of our offsets is always 64 bits on all platforms. Fixes #534
* threads: Fix the shared global state with TLSVicent Marti2011-11-161-1/+3
| | | | | | | See `global.c` for a description of what we're doing. When libgit2 is built with GIT_THREADS support, the threading system must be explicitly initialized with `git_threads_init()`.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-10/+10
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* odb_pack: don't do ambiguity checks for fully qualified SHA1 hashesBrodie Rao2011-10-121-1/+1
| | | | | | | | This makes libgit2 more closely match Git, which only checks for ambiguous pack entries when given short hashes. Note that the only time this is ever relevant is when a pack has the same object more than once (it's happened in the wild, I promise).
* Tabify everythingVicent Marti2011-09-191-21/+21
| | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* Cleanup legal dataVicent Marti2011-09-191-21/+3
| | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* Add casts to get rid of some warnings when filling zlib structuresSebastian Schuberth2011-09-081-1/+1
|
* Drop STRLEN() macrosKirill A. Shutemov2011-08-251-2/+2
| | | | | | | There is no need in STRLEN macros. Compilers can do this trivial optimization on its own. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* Implement cooperative cachingCarlos Martín Nieto2011-08-181-0/+12
| | | | | | | | | When indexing a file with ref deltas, a temporary cache for the offsets has to be built, as we don't have an index file yet. If the user takes the responsiblity for filling the cache, the packing code will look there first when it finds a ref delta. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Rethrow pack entry offset errorCarlos Martín Nieto2011-08-181-1/+1
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Check for error calculating the delta baseCarlos Martín Nieto2011-08-041-0/+2
| | | | | | Don't assume that it's always going to work. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Modify the given offset in git_packfile_unpackCarlos Martín Nieto2011-08-021-13/+22
| | | | | | | | The callers immediately throw away the offset, so we don't need any logical changes in any of them. This will be useful for the indexer, as it does need to know where the compressed data ends. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move pack functions to their own fileCarlos Martín Nieto2011-08-021-9/+490
|
* Make packfile_unpack_header more genericCarlos Martín Nieto2011-08-021-0/+300
On the way, store the fd and the size in the mwindow file. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>