- 08 Jun, 2017 1 commit
-
-
Both the `git_buf_init` and `git_buf_attach` functions may call `git_buf_grow` in case they were given an allocation length as parameter. As such, it is possible for these functions to fail when we run out of memory. While it won't probably be used anytime soon, it does indeed make sense to also record this fact by returning an error code from both functions. As they belong to the internal API only, this change does not break our interface.
Patrick Steinhardt committed
-
- 13 Feb, 2017 1 commit
-
-
When `git_buf_sanitize` gets called, it converts a buffer with NULL content to be correctly initialized. This is done by pointing it to `git_buf__initbuf`. While the method's documentation states this clearly, it may also lead to the conclusion that it will do the same to buffers which do _not_ have NULL contents. Clarify behavior when passing a buffer with non-NULL contents, where `git_buf_sanitize` will ensure that the contents are `\0`-terminated.
Patrick Steinhardt committed
-
- 26 May, 2016 3 commits
-
-
Edward Thomson committed
-
Edward Thomson committed
-
Edward Thomson committed
-
- 24 Jun, 2015 1 commit
-
-
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 1 commit
-
-
Introduce `git_buf_grow_by` to incrementally increase the size of a `git_buf`, performing an overflow calculation on the growth.
Edward Thomson committed
-
- 15 Aug, 2014 1 commit
-
-
Decode base64-encoded text into a git_buf
Edward Thomson 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
-
- 08 Jan, 2014 1 commit
-
-
Edward Thomson committed
-
- 09 Dec, 2013 1 commit
-
-
Edward Thomson committed
-
- 17 Sep, 2013 3 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 -
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 creates include/sys/filter.h with a basic definition of a git_filter and then converts the internal code to use it. There are related internal objects (git_filter_list) that we will want to publish at some point, but this is a first step.
Russell Belfer committed
-
- 01 Jul, 2013 1 commit
-
-
Russell Belfer committed
-
- 07 Mar, 2013 1 commit
-
-
Russell Belfer committed
-
- 30 Jan, 2013 1 commit
-
-
This adds a `git_diff_patch_line_stats()` API that gets the total number of adds, deletes, and context lines in a patch. This will make it a little easier to emulate `git diff --stat` and the like. Right now, this relies on generating the `git_diff_patch` object, which is a pretty heavyweight way to get stat information. At some future point, it would probably be nice to be able to get this information without allocating the entire `git_diff_patch`, but that's a much larger project.
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
-
- 11 Oct, 2012 1 commit
-
-
Paul Thompson committed
-
- 10 Oct, 2012 1 commit
-
-
Russell Belfer committed
-
- 24 Jul, 2012 1 commit
-
-
yorah committed
-
- 11 Jul, 2012 1 commit
-
-
* `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
-
- 17 May, 2012 2 commits
-
-
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
-
- 06 May, 2012 1 commit
-
-
Vicent Martí committed
-
- 03 May, 2012 1 commit
-
-
Vicent Martí committed
-
- 29 Apr, 2012 1 commit
-
-
nulltoken committed
-
- 16 Mar, 2012 1 commit
-
-
Also cleaned up some previously converted code that still had little things to polish.
Russell Belfer committed
-
- 15 Mar, 2012 1 commit
-
-
This converts blob.c, fileops.c, and all of the win32 files. Also, various minor cleanups throughout the code. Plus, in testing the win32 build, I cleaned up a bunch (although not all) of the warnings with the 64-bit build.
Russell Belfer committed
-
- 06 Mar, 2012 1 commit
-
-
This also includes droping `git_buf_lasterror` because it makes no sense in the new system. Note that in most of the places were it has been dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so instead it should return a generic `-1` and obviously not throw anything.
Vicent Martí committed
-
- 02 Mar, 2012 1 commit
-
-
This adds some initial unit tests for file filtering and fixes some simple bugs in filter application.
Russell Belfer committed
-
- 27 Feb, 2012 1 commit
-
-
This makes so much sense that I can't believe it hasn't been done before. Kill the old `git_fbuffer` and read files straight into `git_buf` objects. Also: In order to fully support 4GB files in 32-bit systems, the `git_buf` implementation has been changed from using `ssize_t` for storage and storing negative values on allocation failure, to using `size_t` and changing the buffer pointer to a magical pointer on allocation failure. Hopefully this won't break anything.
Vicent Martí committed
-