- 24 Jun, 2015 2 commits
-
-
This explains more closely what happens. While here, set an error message.
Carlos Martín Nieto committed -
When we don't own a buffer (asize=0) we currently allow the usage of grow to copy the memory into a buffer we do own. This muddles the meaning of grow, and lets us be a bit cavalier with ownership semantics. Don't allow this any more. Usage of grow should be restricted to buffers which we know own their own memory. If unsure, we must not attempt to modify it.
Carlos Martín Nieto committed
-
- 19 Feb, 2015 1 commit
-
-
Provide a convenience function that creates a buffer that can be provided to callers but will not be freed via `git_buf_free`, so the buffer creator maintains the allocation lifecycle of the buffer's contents.
Edward Thomson committed
-
- 13 Feb, 2015 4 commits
-
-
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 -
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 `git_buf_grow_by` to incrementally increase the size of a `git_buf`, performing an overflow calculation on the growth.
Edward Thomson committed -
Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 09 Jan, 2015 1 commit
-
-
Jeff Hostetler committed
-
- 21 Nov, 2014 1 commit
-
-
Vicent Marti committed
-
- 15 Aug, 2014 1 commit
-
-
Decode base64-encoded text into a git_buf
Edward Thomson committed
-
- 16 Jul, 2014 1 commit
-
-
joshaber committed
-
- 08 May, 2014 1 commit
-
-
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.
Russell Belfer committed
-
- 23 Apr, 2014 1 commit
-
-
Edward Thomson committed
-
- 10 Apr, 2014 1 commit
-
-
Allows for inserting the same character n amount of times
Jacques Germishuys committed
-
- 01 Apr, 2014 1 commit
-
-
There are a few places where we need to join three strings to assemble a path. This adds a simple join3 function to avoid the comparatively expensive join_n (which calls strlen on each string twice).
Russell Belfer committed
-
- 25 Feb, 2014 1 commit
-
-
Edward Thomson committed
-
- 20 Jan, 2014 1 commit
-
-
Patrick Reynolds committed
-
- 08 Jan, 2014 1 commit
-
-
Edward Thomson committed
-
- 24 Sep, 2013 1 commit
-
-
This replaces some git_buf_printf calls with simple calls to git_buf_put instead. Also, it fixes a missing va_end inside the git_buf_vprintf implementation.
Russell Belfer committed
-
- 19 Sep, 2013 1 commit
-
-
Linquize committed
-
- 17 Sep, 2013 4 commits
-
-
This makes the git_buf struct that was used internally into an externally available structure and eliminates the git_buffer. As part of that, some of the special cases that arose with the externally used git_buffer were blended into the git_buf, such as being careful about git_buf objects that may have a NULL ptr and allowing for bufs with a valid ptr and size but zero asize as a way of referring to externally owned data.
Russell Belfer committed -
Extend the git2/sys/filter API with functions to look up a filter and add it manually to a filter list. This requires some trickery because the regular attribute lookups and checks are bypassed when this happens, but in the right hands, it will allow a user to have granular control over applying filters.
Russell Belfer committed -
This moves the git_filter_list into the public API so that users can create, apply, and dispose of filter lists. This allows more granular application of filters to user data outside of libgit2 internals. This also converts all the internal usage of filters to the public APIs along with a few small tweaks to make it easier to use the public git_buffer stuff alongside the internal git_buf.
Russell Belfer committed -
This begins the process of exposing git_filter objects to the public API. This includes: * new public type and API for `git_buffer` through which an allocated buffer can be passed to the user * new API `git_blob_filtered_content` * make the git_filter type and GIT_FILTER_TO_... constants public
Russell Belfer committed
-
- 01 Jul, 2013 1 commit
-
-
Russell Belfer committed
-
- 08 Jan, 2013 1 commit
-
-
Edward Thomson committed
-
- 28 Nov, 2012 1 commit
-
-
There are many scattered functions that look into the contents of buffers to do various text manipulations (such as escaping or unescaping data, calculating text stats, guessing if content is binary, etc). This groups all those functions together into a new file and converts the code to use that. This has two enhancements to existing functionality. The old text stats function is significantly rewritten and the BOM detection code was extended (although largely we can't deal with anything other than a UTF8 BOM).
Russell Belfer committed
-
- 25 Oct, 2012 1 commit
-
-
nulltoken committed
-
- 14 Oct, 2012 1 commit
-
-
Philip Kelley committed
-
- 10 Oct, 2012 1 commit
-
-
Russell Belfer committed
-
- 24 Aug, 2012 1 commit
-
-
This fixes up a number of problems flagged by valgrind and also cleans up the internal `git_submodule` allocation handling overall with a simpler model.
Russell Belfer committed
-
- 24 Jul, 2012 1 commit
-
-
yorah committed
-
- 11 Jul, 2012 2 commits
-
-
Russell Belfer committed
-
* `git_buf_rfind` (with tests and tests for `git_buf_rfind_next`) * `git_buf_puts_escaped` and `git_buf_puts_escaped_regex` (with tests) to copy strings into a buffer while injecting an escape sequence (e.g. '\') in front of particular characters.
Russell Belfer committed
-
- 07 Jun, 2012 1 commit
-
-
Vicent Martí committed
-
- 17 May, 2012 3 commits
-
-
Russell Belfer committed
-
This fixes a warning left by the earlier optimization and addresses one of the other hotspots identified by GProf.
Russell Belfer committed -
GProf shows `git_text_gather_stats` as the most expensive call in large diffs. The function calculates a lot of information that is not actually used and does not do so in a optimal order. This introduces a tuned `git_buf_is_binary` function that executes the same algorithm in a fraction of the time.
Russell Belfer committed
-
- 15 May, 2012 2 commits
-
-
This function fills in a git_buf with the common prefix of an array of strings, but let's make that a little more clear.
Russell Belfer committed -
The goal of this work is to rewrite git_status_file to use the same underlying code as git_status_foreach. This is done in 3 phases: 1. Extend iterators to allow ranged iteration with start and end prefixes for the range of file names to be covered. 2. Improve diff so that when there is a pathspec and there is a common non-wildcard prefix of the pathspec, it will use ranged iterators to minimize excess iteration. 3. Rewrite git_status_file to call git_status_foreach_ext with a pathspec that covers just the one file being checked. Since ranged iterators underlie the status & diff implementation, this is actually fairly efficient. The workdir iterator does end up loading the contents of all the directories down to the single file, which should ideally be avoided, but it is pretty good.
Russell Belfer committed
-