Branch Coverage

deps/libgit2/src/libgit2/revwalk.c
Criterion Covered Total %
branch 179 266 67.2


line true false branch
26 92 182 if ((commit = git_oidmap_get(walk->commits, oid)) != NULL)
30 0 182 if (commit == NULL)
35 0 182 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 0 15 GIT_ASSERT_ARG(walk);
103 0 15 GIT_ASSERT_ARG(oid);
113 0 4 GIT_ASSERT_ARG(walk);
114 0 4 GIT_ASSERT_ARG(oid);
124 0 12 if (git_reference_name_to_id(&oid, walk->repo, refname) < 0)
139 0 2 GIT_ASSERT_ARG(walk);
140 0 2 GIT_ASSERT_ARG(glob);
142 2 0 if (given_opts)
146 1 1 if (git__prefixcmp(glob, GIT_REFS_DIR) != 0)
150 0 2 GIT_ERROR_CHECK_ALLOC_STR(&buf);
154 1 1 if (!glob[wildcard])
157 0 2 if ((error = git_reference_iterator_glob_new(&iter, walk->repo, buf.ptr)) < 0)
161 1 2 while ((error = git_reference_next(&ref, iter)) == 0) {
164 0 1 if (error < 0)
169 2 0 if (error == GIT_ITEROVER)
180 0 1 GIT_ASSERT_ARG(walk);
181 0 1 GIT_ASSERT_ARG(glob);
190 0 1 GIT_ASSERT_ARG(walk);
191 0 1 GIT_ASSERT_ARG(glob);
201 0 7 GIT_ASSERT_ARG(walk);
210 0 1 GIT_ASSERT_ARG(walk);
220 0 1 GIT_ASSERT_ARG(walk);
221 0 1 GIT_ASSERT_ARG(refname);
232 1 4 if ((error = git_revparse(&revspec, walk->repo, range)))
235 0 4 if (!revspec.to) {
241 1 3 if (revspec.flags & GIT_REVSPEC_MERGE_BASE) {
249 0 3 if ((error = git_revwalk__push_commit(walk, git_object_id(revspec.from), &opts)))
265 0 2 GIT_ASSERT_ARG(walk);
266 0 2 GIT_ASSERT_ARG(refname);
279 0 0 return git_commit_list_insert(commit, &walk->iterator_rand) ? 0 : -1;
286 11 3 while ((next = git_pqueue_pop(&walk->iterator_time)) != NULL) {
288 11 0 if (!next->uninteresting) {
303 31 16 while (!(error = get_revision(&next, walk, &walk->iterator_rand))) {
305 31 0 if (!next->uninteresting) {
319 11 1 while (!(error = get_revision(&next, walk, &walk->iterator_topo))) {
321 11 0 if (!next->uninteresting) {
333 9 4 return *object_out ? 0 : GIT_ITEROVER;
341 17 38 for (i = 0; i < commit->out_degree; i++)
345 20 38 while (parents) {
348 23 4 while (commit) {
349 16 7 if (commit->uninteresting)
358 0 7 if (!commit->parents)
361 3 7 for (i = 0; i < commit->out_degree; i++)
373 0 78 if (commit->added)
386 17 61 if (commit->uninteresting) {
387 7 17 for (i = 0; i < commit->out_degree; i++) {
392 0 7 if ((error = git_commit_list_parse(walk, p)) < 0)
395 7 0 if (p->parents)
410 51 61 for (i = 0; i < commit->out_degree; i++) {
413 0 51 if ((error = git_commit_list_parse(walk, p)) < 0)
416 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))
419 41 10 if (!p->seen) {
424 0 51 if (walk->first_parent)
436 5 12 if (!list)
443 2 10 if (time <= list->item->time)
446 10 7 for (; list; list = list->next) {
451 7 3 if (!list->item->uninteresting || list->item->time > time)
0 7 if (!list->item->uninteresting || list->item->time > time)
467 60 13 while (list) {
470 0 60 if ((error = add_parents_to_list(walk, commit, &list)) < 0)
473 17 43 if (commit->uninteresting) {
477 12 5 if (slop)
483 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))
501 17 42 if (!commit) {
510 18 24 if (!walk->limited) {
511 0 18 if ((error = add_parents_to_list(walk, commit, list)) < 0)
528 0 5 if (walk->sorting & GIT_SORT_TIME)
531 0 5 if ((error = git_pqueue_init(&queue, 0, 8, queue_cmp)))
540 19 5 for (ll = list; ll; ll = ll->next) {
549 19 5 for(ll = list; ll; ll = ll->next) {
550 18 19 for (i = 0; i < ll->item->out_degree; ++i) {
552 18 0 if (parent->in_degree)
561 19 5 for(ll = list; ll; ll = ll->next) {
562 5 14 if (ll->item->in_degree == 1) {
563 0 5 if ((error = git_pqueue_insert(&queue, ll->item)))
573 5 0 if ((walk->sorting & GIT_SORT_TIME) == 0)
579 19 5 while ((next = git_pqueue_pop(&queue)) != NULL) {
580 18 19 for (i = 0; i < next->out_degree; ++i) {
582 0 18 if (parent->in_degree == 0)
585 14 4 if (--parent->in_degree == 1) {
586 0 14 if ((error = git_pqueue_insert(&queue, parent)))
612 1 26 if (!walk->did_push) {
617 37 26 for (list = walk->user_input; list; list = list->next) {
619 0 37 if ((error = git_commit_list_parse(walk, commit)) < 0)
622 14 23 if (commit->uninteresting)
625 32 5 if (!commit->seen) {
631 18 8 if (walk->limited && (error = limit_list(&commits, walk, commits)) < 0)
0 18 if (walk->limited && (error = limit_list(&commits, walk, commits)) < 0)
634 5 21 if (walk->sorting & GIT_SORT_TOPOLOGICAL) {
638 0 5 if (error < 0)
642 3 18 } else if (walk->sorting & GIT_SORT_TIME) {
643 11 3 for (list = commits; list && !error; list = list->next)
11 0 for (list = commits; list && !error; list = list->next)
648 0 3 if (error < 0)
655 4 22 if (walk->sorting & GIT_SORT_REVERSE) {
657 9 4 while ((error = walk->get_next(&next, walk)) == 0)
658 0 9 if (git_commit_list_insert(next, &walk->iterator_reverse) == NULL)
661 0 4 if (error != GIT_ITEROVER)
675 0 57 GIT_ERROR_CHECK_ALLOC(walk);
678 0 57 git_pqueue_init(&walk->iterator_time, 0, 8, git_commit_list_time_cmp) < 0 ||
687 0 57 if (git_repository_odb(&walk->odb, repo) < 0) {
698 0 57 if (walk == NULL)
712 0 35 GIT_ASSERT_ARG_WITH_RETVAL(walk, NULL);
719 0 12 GIT_ASSERT_ARG(walk);
721 0 12 if (walk->walking)
726 3 9 if (walk->sorting & GIT_SORT_TIME) {
734 11 1 if (walk->sorting != GIT_SORT_NONE)
751 0 74 GIT_ASSERT_ARG(walk);
752 0 74 GIT_ASSERT_ARG(oid);
754 27 47 if (!walk->walking) {
755 1 26 if ((error = prepare_walk(walk)) < 0)
761 20 53 if (error == GIT_ITEROVER) {
767 53 0 if (!error)
777 0 88 GIT_ASSERT_ARG(walk);
779 269 88 git_oidmap_foreach_value(walk->commits, commit, {
807 0 0 GIT_ASSERT_ARG(walk);
809 0 0 if (walk->walking)
815 0 0 if (hide_cb)