- 23 Feb, 2016 1 commit
-
-
We commonly have to check if a git_buf has been allocated correctly or if we ran out of memory. Introduce a new macro similar to `GITERR_CHECK_ALLOC` which checks if we ran OOM and if so returns an error. Provide a `#nodef` for Coverity to mark the error case as an abort path.
Patrick Steinhardt committed
-
- 09 Feb, 2016 1 commit
-
-
Edward Thomson committed
-
- 05 Oct, 2015 1 commit
-
-
Edward Thomson committed
-
- 19 Sep, 2015 1 commit
-
-
Axel Rasmussen committed
-
- 03 Aug, 2015 1 commit
-
-
When an error state is an OOM, make sure that we treat is specially and do not try to free it.
Edward Thomson committed
-
- 29 Jun, 2015 1 commit
-
-
Jeff Hostetler committed
-
- 11 May, 2015 1 commit
-
-
J Wyman committed
-
- 02 Mar, 2015 1 commit
-
-
It's currently required in src/openssl_stream.c only.
Aki Koskinen committed
-
- 13 Feb, 2015 5 commits
-
-
gcc and clang support __builtin_add_overflow, use it whenever possible, falling back to our naive routines.
Edward Thomson committed -
Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
Edward Thomson committed -
Add some helper functions to check for overflow in a type-specific manner.
Edward Thomson committed -
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 03 Feb, 2015 1 commit
-
-
Edward Thomson committed
-
- 05 Dec, 2014 1 commit
-
-
Will Stamper committed
-
- 02 May, 2014 1 commit
-
-
Use an unsigned int for the version and add a helper macro so the code is simplified (and so the error message is a common string).
Russell Belfer committed
-
- 30 Apr, 2014 1 commit
-
-
Jacques Germishuys committed
-
- 17 Apr, 2014 1 commit
-
-
This makes the lock management on the index a little bit broader, having a number of routines hold the lock across looking up the item to be modified and actually making the modification. Still not true thread safety, but more pure index modifications are now safe which allows the simple cases (such as starting up a diff while index modifications are underway) safe enough to get the snapshot without hitting allocation problems. As part of this, I simplified the allocation of index entries to use a flex array and just put the path at the end of the index entry. This makes every entry self-contained and makes it a little easier to feel sure that pointers to strings aren't being accidentally copied and freed while other references are still being held.
Russell Belfer committed
-
- 20 Feb, 2014 1 commit
-
-
* Make GIT_INLINE an internal definition so it cannot be used in public headers * Fix language in CONTRIBUTING * Make index caps API use signed instead of unsigned values
Russell Belfer committed
-
- 11 Dec, 2013 4 commits
-
-
Russell Belfer committed
-
Russell Belfer committed
-
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.
Russell Belfer committed -
This adds giterr_user_cancel to return GIT_EUSER and clear any error message that is sitting around. As a result of using that in places, we need to be more thorough with capturing errors that happen inside a callback when used internally. To help with that, this also adds giterr_capture and giterr_restore so that when we internally use a foreach-type function that clears errors and converts them to GIT_EUSER, it is easier to restore not just the return value, but the actual error message text.
Russell Belfer committed
-
- 09 Dec, 2013 1 commit
-
-
Edward Thomson committed
-
- 01 Nov, 2013 1 commit
-
-
Edward Thomson committed
-
- 01 Apr, 2013 1 commit
-
-
Philip Kelley committed
-
- 15 Mar, 2013 1 commit
-
-
The goal of this work is to expose the search logic for "global", "system", and "xdg" files through the git_libgit2_opts() interface. Behind the scenes, I changed the logic for finding files to have a notion of a git_strarray that represents a search path and to store a separate search path for each of the three tiers of config file. For each tier, I implemented a function to initialize it to default values (generally based on environment variables), and then general interfaces to get it, set it, reset it, and prepend new directories to it. Next, I exposed these interfaces through the git_libgit2_opts interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants for the user to control which search path they were modifying. There are alternative designs for the opts interface / argument ordering, so I'm putting this phase out for discussion. Additionally, I ended up doing a little bit of clean up regarding attr.h and attr_file.h, adding a new attrcache.h so the other two files wouldn't have to be included in so many places.
Russell Belfer committed
-
- 28 Feb, 2013 2 commits
-
-
This fixes some snprintf and vsnprintf related deprecation warnings we've been having on Windows with recent compilers.
Russell Belfer committed -
This removes the one-off GIT_CDECL and adds a new standard way of doing this named GIT_STDLIB_CALL with a src/win32 specific def when on the Windows platform.
Russell Belfer committed
-
- 01 Feb, 2013 1 commit
-
-
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Sven Strickroth committed
-
- 08 Jan, 2013 1 commit
-
-
Edward Thomson committed
-
- 05 Dec, 2012 3 commits
-
-
Vicent Marti committed
-
Vicent Marti committed
-
Vicent Marti committed
-
- 03 Dec, 2012 1 commit
-
-
Ben Straub committed
-
- 01 Dec, 2012 3 commits
-
-
nulltoken committed
-
Ben Straub committed
-
Ben Straub committed
-
- 01 Nov, 2012 1 commit
-
-
Philip Kelley committed
-
- 21 Sep, 2012 1 commit
-
-
There has been discussion for a while about making some set of the `giterr_set` type functions part of the public API for code that is implementing new backends to libgit2. This makes the `giterr_set_str()` and `giterr_set_oom()` functions public.
Russell Belfer committed
-