summaryrefslogtreecommitdiff
path: root/tests/index/cache.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: use legitimate object idsEdward Thomson2016-02-281-3/+3
| | | | | Use legitimate (existing) object IDs in tests so that we have the ability to turn on strict object validation when running tests.
* Clean up some memory leaksEdward Thomson2014-10-261-0/+2
|
* tree-cache: correct the entry_count calculationCarlos Martín Nieto2014-10-221-5/+5
| | | | | | | | | | | | | The entry_count field is the amount of index entries covered by a particular cache entry, that is how many files are there (recursively) under a particular directory. The current code that attemps to do this is severely defincient and is trying to count the amount of children, which always comes up to zero. We don't even need to recount, since we have the information during the cache creation. We can take that number and keep it, as we only ever invalidate or replace.
* index: make sure to write cached subtrees if parent is invalidatedCarlos Martín Nieto2014-10-101-0/+53
| | | | | If e.g. the root tree is invalidated, we still want to write out its children, since those may still have valid cache entries.
* index: write out the tree cache extensionCarlos Martín Nieto2014-10-101-6/+79
| | | | | | | | | | 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.
* index: add tests for the tree cacheCarlos Martín Nieto2014-10-101-0/+110
These test that we invalidate at the right levels and that we remove the tree cache when clearing the index.