Branch Coverage

deps/libgit2/src/cache.c
Criterion Covered Total %
branch 30 58 51.7


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 0 if (git_cache_size(cache) == 0)
54 0 0 git_oidmap_foreach_value(cache->map, object, {
0 0 git_oidmap_foreach_value(cache->map, object, {
69 0 80 if ((git_oidmap_new(&cache->map)) < 0)
85 94 30 if (git_cache_size(cache) == 0)
88 258 30 git_oidmap_foreach_value(cache->map, evict, {
121 0 0 if (evict_count < 8)
125 0 0 if (evict_count > git_cache_size(cache)) {
131 0 0 while (evict_count > 0) {
135 0 0 if (git_oidmap_iterate((void **) &evict, cache->map, &i, &key) == GIT_ITEROVER)
151 1131 0 return git_cache__enabled && object_size < max_size;
678 453 return git_cache__enabled && object_size < max_size;
158 0 2827 if (!git_cache__enabled || git_rwlock_rdlock(&cache->lock) < 0)
161 1683 1144 if ((entry = git_oidmap_get(cache->map, oid)) != NULL) {
162 374 1309 if (flags && entry->flags != flags) {
371 3 if (flags && entry->flags != flags) {
180 0 1131 if (!git_cache__enabled && cache->used_memory > 0) {
0 0 if (!git_cache__enabled && cache->used_memory > 0) {
185 453 678 if (!cache_should_store(entry->type, entry->size))
192 0 678 if (git_cache__current_storage.val > git_cache__max_storage)
196 258 420 if ((stored_entry = git_oidmap_get(cache->map, &entry->oid)) == NULL) {
197 258 0 if (git_oidmap_set(cache->map, &entry->oid, entry) == 0) {
205 7 413 if (stored_entry->flags == entry->flags) {
209 182 231 } else if (stored_entry->flags == GIT_CACHE_STORE_RAW &&
182 0 } else if (stored_entry->flags == GIT_CACHE_STORE_RAW &&
211 182 0 if (git_oidmap_set(cache->map, &entry->oid, entry) == 0) {
259 1122 3067 if (git_atomic_dec(&obj->refcount) == 0) {