Branch Coverage

deps/libgit2/src/mwindow.c
Criterion Covered Total %
branch 42 128 32.8


line true false branch
48 0 86 assert(!git__pack_cache);
60 0 4 if ((error = git_packfile__name(&packname, path)) < 0)
63 0 4 if (git_mutex_lock(&git__mwindow_mutex) < 0) {
71 0 4 if (pack != NULL) {
79 0 4 if ((error = git_packfile_alloc(&pack, path)) < 0) {
89 0 4 if (error < 0) {
102 0 3 if (git_mutex_lock(&git__mwindow_mutex) < 0)
106 0 3 assert(git__pack_cache);
109 0 3 assert(git_strmap_exists(git__pack_cache, pack->pack_name));
112 3 0 if (count == 0) {
123 0 96 if (git_mutex_lock(&git__mwindow_mutex)) {
145 8 91 for (i = 0; i < ctl->windowfiles.length; ++i){
146 8 0 if (git_vector_get(&ctl->windowfiles, i) == mwf) {
152 99 0 if (ctl->windowfiles.length == 0) {
157 48 99 while (mwf->windows) {
159 0 48 assert(w->inuse_cnt == 0);
178 212 0 && offset <= (off64_t)(win_off + win->window_map.len);
212 0 && offset <= (off64_t)(win_off + win->window_map.len);
203 0 0 assert(mwf);
204 0 0 assert(out_window);
207 0 0 if (out_last)
210 0 0 for (w_last = NULL, w = mwf->windows; w; w_last = w, w = w->next) {
211 0 0 if (w->inuse_cnt) {
212 0 0 if (only_unused)
223 0 0 if (!lru_window ||
0 0 if (!lru_window ||
224 0 0 (comparison_sign == GIT_MWINDOW__LRU && lru_window->last_used > w->last_used) ||
0 0 (comparison_sign == GIT_MWINDOW__LRU && lru_window->last_used > w->last_used) ||
225 0 0 (comparison_sign == GIT_MWINDOW__MRU && lru_window->last_used < w->last_used)) {
232 0 0 if (!found)
236 0 0 if (out_last)
252 0 0 git_vector_foreach(&ctl->windowfiles, i, cur) {
253 0 0 if (git_mwindow_scan_recently_used(
259 0 0 if (!lru_window) {
267 0 0 if (lru_last)
292 0 0 git_vector_foreach(&ctl->windowfiles, i, current_file) {
294 0 0 if (!git_mwindow_scan_recently_used(
298 0 0 if (!lru_window || lru_window->last_used > mru_window->last_used)
0 0 if (!lru_window || lru_window->last_used > mru_window->last_used)
302 0 0 if (!lru_file) {
327 0 48 if (w == NULL)
334 0 48 if (len > (off64_t)git_mwindow__window_size)
348 0 48 if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) {
354 0 0 while (git_mwindow_close_lru_window() == 0)
357 0 0 if (git_futils_mmap_ro(&w->window_map, fd, w->offset, (size_t)len) < 0) {
366 23 25 if (ctl->mapped > ctl->peak_mapped)
369 3 45 if (ctl->open_windows > ctl->peak_open_windows)
389 0 154 if (git_mutex_lock(&git__mwindow_mutex)) {
394 0 154 if (!w || !(git_mwindow_contains(w, offset) && git_mwindow_contains(w, offset + extra))) {
0 0 if (!w || !(git_mwindow_contains(w, offset) && git_mwindow_contains(w, offset + extra))) {
0 0 if (!w || !(git_mwindow_contains(w, offset) && git_mwindow_contains(w, offset + extra))) {
395 0 154 if (w) {
399 106 48 for (w = mwf->windows; w; w = w->next) {
409 48 106 if (!w) {
411 0 48 if (w == NULL) {
421 154 0 if (w != *cursor) {
429 154 0 if (left)
441 0 8 if (git_mutex_lock(&git__mwindow_mutex)) {
452 0 8 if (git_mwindow__file_limit) {
469 0 0 if (git_mutex_lock(&git__mwindow_mutex))
472 0 0 git_vector_foreach(&ctl->windowfiles, i, cur) {
473 0 0 if (cur == mwf) {
485 154 50 if (w) {
486 0 154 if (git_mutex_lock(&git__mwindow_mutex)) {