Branch Coverage

deps/libgit2/src/revwalk.c
Criterion Covered Total %
branch 180 268 67.1


line true false branch
26 92 180 if ((commit = git_oidmap_get(walk->commits, oid)) != NULL)
30 0 180 if (commit == NULL)
35 0 180 if ((git_oidmap_set(walk->commits, &commit->oid, commit)) < 0)
49 0 37 if ((error = git_object_lookup(&oobj, walk->repo, oid, GIT_OBJECT_ANY)) < 0)
55 37 0 if (error == GIT_ENOTFOUND || error == GIT_EINVALIDSPEC || error == GIT_EPEEL) {
37 0 if (error == GIT_ENOTFOUND || error == GIT_EINVALIDSPEC || error == GIT_EPEEL) {
0 37 if (error == GIT_ENOTFOUND || error == GIT_EINVALIDSPEC || error == GIT_EPEEL) {
57 0 0 if (opts->from_glob)
63 0 37 if (error < 0)
70 0 37 if (commit == NULL)
74 0 37 if (commit->uninteresting)
77 10 27 if (opts->uninteresting) {
87 0 37 git_commit_list_insert_by_date(commit, &list) == NULL) ||
102 15 0 assert(walk && oid);
0 15 assert(walk && oid);
111 4 0 assert(walk && oid);
0 4 assert(walk && oid);
121 0 12 if (git_reference_name_to_id(&oid, walk->repo, refname) < 0)
136 2 0 assert(walk && glob);
0 2 assert(walk && glob);
138 2 0 if (given_opts)
142 1 1 if (git__prefixcmp(glob, GIT_REFS_DIR) != 0)
146 0 2 GIT_ERROR_CHECK_ALLOC_BUF(&buf);
150 1 1 if (!glob[wildcard])
153 0 2 if ((error = git_reference_iterator_glob_new(&iter, walk->repo, buf.ptr)) < 0)
157 1 2 while ((error = git_reference_next(&ref, iter)) == 0) {
160 0 1 if (error < 0)
165 2 0 if (error == GIT_ITEROVER)
175 1 0 assert(walk && glob);
0 1 assert(walk && glob);
183 1 0 assert(walk && glob);
0 1 assert(walk && glob);
192 0 7 assert(walk);
200 0 1 assert(walk);
209 1 0 assert(walk && refname);
0 1 assert(walk && refname);
220 1 4 if ((error = git_revparse(&revspec, walk->repo, range)))
223 0 4 if (!revspec.to) {
229 1 3 if (revspec.flags & GIT_REVPARSE_MERGE_BASE) {
237 0 3 if ((error = git_revwalk__push_commit(walk, git_object_id(revspec.from), &opts)))
252 2 0 assert(walk && refname);
0 2 assert(walk && refname);
264 0 0 return git_commit_list_insert(commit, &walk->iterator_rand) ? 0 : -1;
271 11 3 while ((next = git_pqueue_pop(&walk->iterator_time)) != NULL) {
273 11 0 if (!next->uninteresting) {
288 31 16 while (!(error = get_revision(&next, walk, &walk->iterator_rand))) {
290 31 0 if (!next->uninteresting) {
304 11 1 while (!(error = get_revision(&next, walk, &walk->iterator_topo))) {
306 11 0 if (!next->uninteresting) {
318 9 4 return *object_out ? 0 : GIT_ITEROVER;
326 17 38 for (i = 0; i < commit->out_degree; i++)
330 20 38 while (parents) {
333 23 4 while (commit) {
334 16 7 if (commit->uninteresting)
343 0 7 if (!commit->parents)
346 3 7 for (i = 0; i < commit->out_degree; i++)
358 0 78 if (commit->added)
371 17 61 if (commit->uninteresting) {
372 7 17 for (i = 0; i < commit->out_degree; i++) {
377 0 7 if ((error = git_commit_list_parse(walk, p)) < 0)
380 7 0 if (p->parents)
395 51 61 for (i = 0; i < commit->out_degree; i++) {
398 0 51 if ((error = git_commit_list_parse(walk, p)) < 0)
401 0 51 if (walk->hide_cb && walk->hide_cb(&p->oid, walk->hide_cb_payload))
0 0 if (walk->hide_cb && walk->hide_cb(&p->oid, walk->hide_cb_payload))
404 41 10 if (!p->seen) {
409 0 51 if (walk->first_parent)
421 5 12 if (!list)
428 2 10 if (time <= list->item->time)
431 10 7 for (; list; list = list->next) {
436 7 3 if (!list->item->uninteresting || list->item->time > time)
0 7 if (!list->item->uninteresting || list->item->time > time)
452 60 13 while (list) {
455 0 60 if ((error = add_parents_to_list(walk, commit, &list)) < 0)
458 17 43 if (commit->uninteresting) {
462 12 5 if (slop)
468 0 43 if (walk->hide_cb && walk->hide_cb(&commit->oid, walk->hide_cb_payload))
0 0 if (walk->hide_cb && walk->hide_cb(&commit->oid, walk->hide_cb_payload))
486 17 42 if (!commit) {
495 18 24 if (!walk->limited) {
496 0 18 if ((error = add_parents_to_list(walk, commit, list)) < 0)
513 0 5 if (walk->sorting & GIT_SORT_TIME)
516 0 5 if ((error = git_pqueue_init(&queue, 0, 8, queue_cmp)))
525 19 5 for (ll = list; ll; ll = ll->next) {
534 19 5 for(ll = list; ll; ll = ll->next) {
535 18 19 for (i = 0; i < ll->item->out_degree; ++i) {
537 18 0 if (parent->in_degree)
546 19 5 for(ll = list; ll; ll = ll->next) {
547 5 14 if (ll->item->in_degree == 1) {
548 0 5 if ((error = git_pqueue_insert(&queue, ll->item)))
558 5 0 if ((walk->sorting & GIT_SORT_TIME) == 0)
564 19 5 while ((next = git_pqueue_pop(&queue)) != NULL) {
565 18 19 for (i = 0; i < next->out_degree; ++i) {
567 0 18 if (parent->in_degree == 0)
570 14 4 if (--parent->in_degree == 1) {
571 0 14 if ((error = git_pqueue_insert(&queue, parent)))
597 1 26 if (!walk->did_push) {
602 37 26 for (list = walk->user_input; list; list = list->next) {
604 0 37 if ((error = git_commit_list_parse(walk, commit)) < 0)
607 14 23 if (commit->uninteresting)
610 32 5 if (!commit->seen) {
616 18 8 if (walk->limited && (error = limit_list(&commits, walk, commits)) < 0)
0 18 if (walk->limited && (error = limit_list(&commits, walk, commits)) < 0)
619 5 21 if (walk->sorting & GIT_SORT_TOPOLOGICAL) {
623 0 5 if (error < 0)
627 3 18 } else if (walk->sorting & GIT_SORT_TIME) {
628 11 3 for (list = commits; list && !error; list = list->next)
11 0 for (list = commits; list && !error; list = list->next)
633 0 3 if (error < 0)
640 4 22 if (walk->sorting & GIT_SORT_REVERSE) {
642 9 4 while ((error = walk->get_next(&next, walk)) == 0)
643 0 9 if (git_commit_list_insert(next, &walk->iterator_reverse) == NULL)
646 0 4 if (error != GIT_ITEROVER)
660 0 56 GIT_ERROR_CHECK_ALLOC(walk);
662 0 56 if (git_oidmap_new(&walk->commits) < 0)
665 0 56 if (git_pqueue_init(&walk->iterator_time, 0, 8, git_commit_list_time_cmp) < 0)
674 0 56 if (git_repository_odb(&walk->odb, repo) < 0) {
685 0 56 if (walk == NULL)
699 0 35 assert(walk);
705 0 12 assert(walk);
707 0 12 if (walk->walking)
712 3 9 if (walk->sorting & GIT_SORT_TIME) {
720 11 1 if (walk->sorting != GIT_SORT_NONE)
737 74 0 assert(walk && oid);
0 74 assert(walk && oid);
739 27 47 if (!walk->walking) {
740 1 26 if ((error = prepare_walk(walk)) < 0)
746 20 53 if (error == GIT_ITEROVER) {
752 53 0 if (!error)
762 0 87 assert(walk);
764 267 87 git_oidmap_foreach_value(walk->commits, commit, {
792 0 0 assert(walk);
794 0 0 if (walk->walking)
800 0 0 if (hide_cb)