Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2013-11-07Allow callers to set mode on packfile creationEdward Thomson
2013-10-30indexer: remove the stream infixCarlos Martín Nieto
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.
2013-10-28Merge pull request #1891 from libgit2/cmn/fix-thin-packsVicent Martí
Add support for thin packs
2013-10-04indexer: fix thin packsCarlos Martín Nieto
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.
2013-10-03Initial iconv hookup for precomposed unicodeRussell Belfer
This hooks up git_path_direach and git_path_dirload so that they will take a flag indicating if directory entry names should be tested and converted from decomposed unicode to precomposed form. This code will only come into play on the Apple platform and even then, only when certain types of filesystems are used. This involved adding a flag to these functions which involved changing a lot of places in the code. This was an opportunity to do a bit of code cleanup here and there, for example, getting rid of the git_futils_cleanupdir_r function in favor of a simple flag to git_futils_rmdir_r to not remove the top level entry. That ended up adding depth tracking during rmdir_r which led to a safety check for infinite directory recursion. Yay. This hasn't actually been tested on the Mac filesystems where the issue occurs. I still need to get test environment for that.
2013-09-11path: Make direach() return EUSER on callback errornulltoken
2013-09-04odb: Move the auto refresh logic to the pack backendnulltoken
Previously, `git_object_read()`, `git_object_read_prefix()` and `git_object_exists()` were implementing an auto refresh logic. When the expected object couldn't be found in any backend, a call to `git_odb_refresh()` was triggered and the lookup was once again performed against all backends. This commit removes this auto-refresh logic from the odb layer and pushes it down into the pack-backend (as it's the only one currently exposing a `refresh()` endpoint).
2013-08-31odb: Code beautificationnulltoken
2013-08-08odb_pack: handle duplicate objects from different packsBrodie Rao
This is based on 24634c6fd02b2240e4a93fad70a08220f8fb793a. This also corrects an issue with error codes being mixed up with the number of found objects.
2013-04-22Consolidate packfile allocation furtherRussell Belfer
Rename git_packfile_check to git_packfile_alloc since it is now being used more in that capacity. Fix the various places that use it. Consolidate some repeated code in odb_pack.c related to the allocation of a new pack_backend.
2013-04-21Move odb_backend implementors stuff into git2/sysRussell Belfer
This moves some of the odb_backend stuff that is related to the internals of an odb_backend implementation into include/git2/sys. Some of the stuff related to streaming I left in include/git2 because it seemed like it would be reasonably needed by a normal user who wanted to stream objects into and out of the ODB. Also, I added APIs for traversing the list of backends so that some of the tests would not need to access ODB internals.
2013-03-18Several warnings detected by static code analyzer fixedArkadiy Shapkin
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
2013-03-15odb_pack: Unused functionsVicent Marti
2013-01-12indexer: properly free the packfile resourcesCarlos Martín Nieto
The indexer needs to call the packfile's free function so it takes care of freeing the caches. We still need to close the mwf descriptor manually so we can rename the packfile into its final name on Windows.
2013-01-11Revert "pack: packfile_free -> git_packfile_free and use it in the indexers"Carlos Martín Nieto
This reverts commit f289f886cb81bb570bed747053d5ebf8aba6bef7, which makes the tests fail on Windows. Revert until we can figure out a solution.
2013-01-11pack: packfile_free -> git_packfile_free and use it in the indexersCarlos Martín Nieto
It turns out the indexers have been ignoring the pack's free function and leaking data. Plug that.
2013-01-10dat errorcodeVicent Marti
2013-01-10Sane refresh logicVicent Marti
All the ODB backends have a specific refresh interface. When reading an object, first we attempt every single backend: if the read fails, then we refresh all the backends and retry the read one more time to see if the object has appeared.
2013-01-09update copyrightsEdward Thomson
2012-12-05Merge pull request #1115 from ben/struct-versionsVicent Martí
Version info for public structs
2012-12-03odb-pack: resurrect pack_backend__read_headerDavid Michael Barr
2012-12-01Deploy versioned git_odb_backend structureBen Straub
2012-11-28Make git_odb_foreach_cb take const paramRussell Belfer
This makes the first OID param of the ODB callback a const pointer and also propogates that change all the way to the backends.
2012-11-06create callback to handle packs from fetch, move the indexer to odb_packEdward Thomson
2012-09-19ODB pack: snapshot last_found to avoid raceBen Straub
Also removed unnecessary refresh call and fixed some indentation.
2012-09-19Remove mtime checks from ODB packfile backendBen Straub
Now forcing refresh on a foreach, and on missed full-oid or short-oid lookups.
2012-09-19ODB: re-load packfiles on failed lookupBen Straub
The old method was avoiding re-loading of packfiles by watching the mtime of the pack directory. This causes the ODB to become stale if the directory and packfile are written within the same clock millisecond, as when cloning a fairly small repo. This method tries to find the object in the cached packs, and forces a refresh when that fails. This will cause extra stat'ing on a miss, but speeds up the success case and avoids this race condition.
2012-09-15odb_pack: fix race conditionMichael Schubert
last_found is the last packfile a wanted object was found in. Since last_found is shared among all searching threads, it might changes while we're searching. As suggested by @arrbee, put a copy on the stack to fix the race condition.
2012-09-13odb_pack: try lookup before refreshing packsDavid Michael Barr
This reduces the rate of syscalls for the common case of sequences of object reads from the same pack. Best of 5 timings for libgit2_clar before this patch: real 0m5.375s user 0m0.392s sys 0m3.564s After applying this patch: real 0m5.285s user 0m0.356s sys 0m3.544s 0.6% improvement in system time. 9.2% improvement in user time. 1.7% improvement in elapsed time. Confirmed a 0.6% reduction in number of system calls with strace. Expect greater improvement for graph-traversal with large packs.
2012-09-04odb: pass the user's data pointer correctly in foreachCarlos Martín Nieto
2012-08-06Merge remote-tracking branch 'arrbee/tree-walk-fixes' into developmentVicent Marti
Conflicts: src/notes.c src/transports/git.c src/transports/http.c src/transports/local.c tests-clar/odb/foreach.c
2012-08-04Update iterators for consistency across libraryRussell Belfer
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.
2012-08-02Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into developmentVicent Marti
Conflicts: src/netops.c src/netops.h src/oid.c
2012-07-24portability: Improve x86/amd64 compatibilitynulltoken
2012-07-21odb: allow creating an ODB backend from a packfile indexCarlos Martín Nieto
git_odb_backend_one_packfile() allows us to create an ODB backend out of an .idx file.
2012-07-03odb: add git_odb_foreach()Carlos Martín Nieto
Go through each backend and list every objects that exists in them. This allows fsck-like uses.
2012-05-05Fix valgrind issuesRussell Belfer
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
2012-04-30buf: deploy git_buf_len()nulltoken
2012-04-17Fix warnings on 64-bit windows buildsRussell Belfer
This fixes all the warnings on win64 except those in deps, which come from the regex code.
2012-03-17Convert attr, ignore, mwindow, status to new errorsRussell Belfer
Also cleaned up some previously converted code that still had little things to polish.
2012-03-13Migrate ODB files to new error handlingRussell Belfer
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.
2012-03-06error-handling: ReferencesVicent Martí
Yes, this is error handling solely for `refs.c`, but some of the abstractions leak all ofer the code base.
2012-03-03Clean up GIT_UNUSED macros on all platformsRussell Belfer
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.
2012-02-15zlib: Remove custom `git2/zlib.h` headerVicent Martí
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.
2012-02-13Update Copyright headerschu
Signed-off-by: schu <schu-github@schulog.org>
2012-01-18Move path related functions from fileops to pathRussell Belfer
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).
2011-12-08Use git_buf for path storage instead of stack-based buffersRussell Belfer
This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
2011-10-29global: Properly use `git__` memory wrappersVicent Marti
Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
2011-10-04ignore missing pack file as git doesSven Strickroth
See http://code.google.com/p/tortoisegit/issues/detail?id=862 Signed-off-by: Sven Strickroth <email@cs-ware.de>
2011-09-19Merge pull request #384 from kiryl/warningsVicent Martí
Add more -W flags to CFLAGS