Branch Coverage

deps/libgit2/src/cache.c
Criterion Covered Total %
branch 30 52 57.6


line true false branch
35 0 0 if (type < 0 || (size_t)type >= ARRAY_SIZE(git_cache__max_object_size)) {
0 0 if (type < 0 || (size_t)type >= ARRAY_SIZE(git_cache__max_object_size)) {
48 0 99 if ((git_oidmap_new(&cache->map)) < 0)
64 128 30 if (git_cache_size(cache) == 0)
67 258 30 git_oidmap_foreach_value(cache->map, evict, {
100 0 0 if (evict_count < 8)
104 0 0 if (evict_count > git_cache_size(cache)) {
110 0 0 while (evict_count > 0) {
114 0 0 if (git_oidmap_iterate((void **) &evict, cache->map, &i, &key) == GIT_ITEROVER)
130 1155 0 return git_cache__enabled && object_size < max_size;
678 477 return git_cache__enabled && object_size < max_size;
137 0 2852 if (!git_cache__enabled || git_rwlock_rdlock(&cache->lock) < 0)
140 1683 1169 if ((entry = git_oidmap_get(cache->map, oid)) != NULL) {
141 374 1309 if (flags && entry->flags != flags) {
371 3 if (flags && entry->flags != flags) {
159 0 1155 if (!git_cache__enabled && cache->used_memory > 0) {
0 0 if (!git_cache__enabled && cache->used_memory > 0) {
164 477 678 if (!cache_should_store(entry->type, entry->size))
171 0 678 if (git_cache__current_storage.val > git_cache__max_storage)
175 258 420 if ((stored_entry = git_oidmap_get(cache->map, &entry->oid)) == NULL) {
176 258 0 if (git_oidmap_set(cache->map, &entry->oid, entry) == 0) {
184 7 413 if (stored_entry->flags == entry->flags) {
188 182 231 } else if (stored_entry->flags == GIT_CACHE_STORE_RAW &&
182 0 } else if (stored_entry->flags == GIT_CACHE_STORE_RAW &&
190 182 0 if (git_oidmap_set(cache->map, &entry->oid, entry) == 0) {
238 1146 3079 if (git_atomic_dec(&obj->refcount) == 0) {