mirror of
https://git.proxmox.com/git/libgit2
synced 2025-11-03 09:20:05 +00:00
This updates the tree iterator internals to be more efficient. The tree_iterator_entry objects are now kept as pointers that are allocated from a git_pool, so that we may use git__tsort_r for sorting (which is better than qsort, given that the tree is likely mostly ordered already). Those tree_iterator_entry objects now keep direct pointers to the data they refer to instead of keeping indirect index values. This simplifies a lot of the data structure traversal code. This also adds bsearch to find the start item position for range- limited tree iterators, and is more explicit about using git_path_cmp instead of reimplementing it. The git_path_cmp changed a bit to make it easier for tree_iterators to use it (but it was barely being used previously, so not a big deal). This adds a git_pool_free_array function that efficiently frees a list of pool allocated pointers (which the tree_iterator keeps). Also, added new tests for the git_pool free list functionality that was not previously being tested (or used). |
||
|---|---|---|
| .. | ||
| attr | ||
| buf | ||
| checkout | ||
| clar | ||
| clone | ||
| commit | ||
| config | ||
| core | ||
| date | ||
| diff | ||
| fetchhead | ||
| index | ||
| merge | ||
| network | ||
| notes | ||
| object | ||
| odb | ||
| online | ||
| pack | ||
| refdb | ||
| refs | ||
| repo | ||
| reset | ||
| resources | ||
| revwalk | ||
| stash | ||
| status | ||
| submodule | ||
| threads | ||
| trace | ||
| clar_libgit2.c | ||
| clar_libgit2.h | ||
| clar.c | ||
| clar.h | ||
| generate.py | ||
| main.c | ||
| README.md | ||
| valgrind-supp-mac.txt | ||
Writing Clar tests for libgit2
For information on the Clar testing framework and a detailed introduction please visit:
-
Write your modules and tests. Use good, meaningful names.
-
Make sure you actually build the tests by setting:
cmake -DBUILD_CLAR=ON build/ -
Test:
./build/libgit2_clar -
Make sure everything is fine.
-
Send your pull request. That's it.