- 14 Nov, 2016 3 commits
-
-
We look at whether we're trying to replace a blob with a tree during the update phase, but we fail to look at whether we've just inserted a blob where we're now trying to insert a tree. Update the check to look at both places. The test for this was previously succeeding due to the bu where we did not look at the sorted output.
Carlos Martín Nieto committed -
The loop is made with the assumption that the inputs are sorted and not using it leads to bad outputs.
Carlos Martín Nieto committed -
Patrick Steinhardt committed
-
- 07 Oct, 2016 1 commit
-
-
When parsing tree entries from raw object data, we do not verify that the tree entry actually has a filename as well as a valid object ID. Fix this by asserting that the filename length is non-zero as well as asserting that there are at least `GIT_OID_RAWSZ` bytes left when parsing the OID.
Patrick Steinhardt committed
-
- 24 May, 2016 1 commit
-
-
When we remove all entries in a tree, we should remove that tree from its parent rather than include the empty tree.
Carlos Martín Nieto committed
-
- 19 May, 2016 2 commits
-
-
Carlos Martín Nieto committed
-
When we want to remove the file, use the basename as the name of the entry to remove, instead of the full one, which includes the directories we've inserted into the stack.
Carlos Martín Nieto committed
-
- 18 May, 2016 1 commit
-
-
0120000 is symbolic link, not commit
Carl Edquist committed
-
- 17 May, 2016 1 commit
-
-
Instead of going through the usual steps of reading a tree recursively into an index, modifying it and writing it back out as a tree, introduce a function to perform simple updates more efficiently. `git_tree_create_updated` avoids reading trees which are not modified and supports upsert and delete operations. It is not as versatile as modifying the index, but it makes some common operations much more efficient.
Carlos Martín Nieto committed
-
- 31 Mar, 2016 1 commit
-
-
Carlos Martín Nieto committed
-
- 22 Mar, 2016 1 commit
-
-
Remove the now-unnecessary entries vector. Add `git_array_search` to binary search through an array to accomplish this.
Edward Thomson committed
-
- 20 Mar, 2016 2 commits
-
-
Take advantage of the constant size of tree-owned arrays and store them in an array instead of a pool. This still lets us free them all at once but lets the system allocator do the work of fitting them in.
Carlos Martín Nieto committed -
Instead of copying over the data into the individual entries, point to the originals, which are already in a format we can use.
Carlos Martín Nieto committed
-
- 04 Mar, 2016 1 commit
-
-
Submodules don't exist in the objectdb and the code is making us try to look for a blob with its commit id, which is obviously not going to work. Skip the test if the user wants to insert a submodule.
Carlos Martín Nieto committed
-
- 28 Feb, 2016 1 commit
-
-
When `GIT_OPT_ENABLE_STRICT_OBJECT_CREATION` is turned on, validate the tree and parent ids given to treebuilder insertion.
Edward Thomson committed
-
- 16 Feb, 2016 1 commit
-
-
Edward Thomson committed
-
- 06 Dec, 2015 1 commit
-
-
The trees are sorted on-disk, so we don't have to go over them again. This cuts almost a fifth of time spent parsing trees.
Carlos Martín Nieto committed
-
- 02 Dec, 2015 1 commit
-
-
Instead of going out to strtol, which is made to parse generic numbers, copy a parse function from git which is specialised for file modes.
Carlos Martín Nieto committed
-
- 01 Dec, 2015 1 commit
-
-
When duplicating a `struct git_tree_entry` with `git_tree_entry_dup` the resulting structure is not allocated inside a memory pool. As we do a 1:1 copy of the original struct, though, we also copy the `pooled` field, which is set to `true` for pooled entries. This results in a huge memory leak as we never free tree entries that were duplicated from a pooled tree entry. Fix this by marking the newly duplicated entry as un-pooled.
Patrick Steinhardt committed
-
- 30 Nov, 2015 1 commit
-
-
Return an error in case the length is too big. Also take this opportunity to have a single allocating function for the size and overflow logic.
Carlos Martín Nieto committed
-
- 28 Nov, 2015 4 commits
-
-
This reduces the size of the struct from 32 to 26 bytes, and leaves a single padding byte at the end of the struct (which comes from the zero-length array).
Carlos Martín Nieto committed -
We already know the size due to the `memchr()` so use that information instead of calling `strlen()` on it.
Carlos Martín Nieto committed -
These are rather small allocations, so we end up spending a non-trivial amount of time asking the OS for memory. Since these entries are tied to the lifetime of their tree, we can give the tree a pool so we speed up the allocations.
Carlos Martín Nieto committed -
We've already looked at the filename with `memchr()` and then used `strlen()` to allocate the entry. We already know how much we have to advance to get to the object id, so add the filename length instead of looking at each byte again.
Carlos Martín Nieto committed
-
- 17 Mar, 2015 1 commit
-
-
Don't use the full path, as that's not what we are asserting does not exist, but just the subpath we were looking up.
Carlos Martín Nieto committed
-
- 15 Feb, 2015 1 commit
-
-
Without this change, compiling with gcc and pedantic generates warning: ISO C does not allow extra ‘;’ outside of a function.
Stefan Widgren committed
-
- 13 Feb, 2015 3 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 some helper macros to test integer overflow from arithmetic and set error message appropriately.
Edward Thomson committed
-
- 27 Dec, 2014 1 commit
-
-
This function is a constructor, so let's name it like one and leave _create() for the reference functions, which do create/write the reference.
Carlos Martín Nieto committed
-
- 17 Dec, 2014 1 commit
-
-
Path validation may be influenced by `core.protectHFS` and `core.protectNTFS` configuration settings, thus treebuilders can take a repository to influence their configuration.
Edward Thomson committed
-
- 16 Dec, 2014 1 commit
-
-
Vicent Marti committed
-
- 10 Oct, 2014 2 commits
-
-
An obvious place to fill the tree cache is on write-tree, as we're guaranteed to be able to fill in the whole tree cache. The way this commit does this is not the most efficient, as we read the root tree from the odb instead of filling in the cache as we go along, but it fills the cache such that successive operations (and persisting the index to disk) will be able to take advantage of the cache, and it reuses the code we already have for filling the cache. Filling in the cache as we create the trees would require some reallocation of the children vector, which is currently not possible with out pool implementation. A different data structure would likely allow us to perform this operation at a later date.
Carlos Martín Nieto committed -
Keeping the cache around after read-tree is only one part of the optimisation opportunities. In order to share the cache between program instances, we need to write the TREE extension to the index. Do so, taking the opportunity to rename 'entries' to 'entry_count' to match the name given in the format description. The included test is rather trivial, but works as a sanity check.
Carlos Martín Nieto committed
-
- 25 Jun, 2014 1 commit
-
-
As reported by coverity, we would leak some memory in error conditions.
Carlos Martín Nieto committed
-
- 10 Jun, 2014 3 commits
-
-
We can simply ask the hasmap.
Carlos Martín Nieto committed -
If the user wants to keep a copy for themselves, they should make a copy. It adds unnecessary complexity to make sure the returned entries are valid until the builder is cleared.
Carlos Martín Nieto committed -
Finding a filename in a vector means we need to resort it every time we want to read from it, which includes every time we want to write to it as well, as we want to find duplicate keys. A hash-map fits what we want to do much more accurately, as we do not care about sorting, but just the particular filename. We still keep removed entries around, as the interface let you assume they were going to be around until the treebuilder is cleared or freed, but in this case that involves an append to a vector in the filter case, which can now fail. The only time we care about sorting is when we write out the tree, so let's make that the only time we do any sorting.
Carlos Martín Nieto committed
-
- 09 Jun, 2014 1 commit
-
-
By inserting in the right position, we can keep the vector sorted, making entry insertion almost twice as fast.
Carlos Martín Nieto committed
-
- 04 Feb, 2014 1 commit
-
-
This updates the git_pqueue to simply be a set of specialized init/insert/pop functions on a git_vector. To preserve the pqueue feature of having a fixed size heap, I converted the "sorted" field in git_vectors to a more general "flags" field so that pqueue could mix in it's own flag. This had a bunch of ramifications because a number of places were directly looking at the vector "sorted" field - I added a couple new git_vector helpers (is_sorted, set_sorted) so the specific representation of this information could be abstracted.
Russell Belfer committed
-