Branch Coverage

deps/libgit2/src/libgit2/describe.c
Criterion Covered Total %
branch 0 298 0.0


line true false branch
60 0 0 if (!e || e->prio < prio)
0 0 if (!e || e->prio < prio)
63 0 0 if (e->prio == 2 && prio == 2) {
0 0 if (e->prio == 2 && prio == 2) {
69 0 0 if (!e->tag) {
70 0 0 if (git_tag_lookup(&t, repo, &e->sha1) < 0)
75 0 0 if (git_tag_lookup(&t, repo, sha1) < 0)
80 0 0 if (e->tag->tagger)
83 0 0 if (t->tagger)
86 0 0 if (e_time < t_time)
105 0 0 if (replace_name(&tag, repo, e, prio, sha1)) {
106 0 0 if (!found) {
108 0 0 GIT_ERROR_CHECK_ALLOC(e);
114 0 0 if (e->tag)
124 0 0 if (!found && git_oidmap_set(names, &e->peeled, e) < 0)
0 0 if (!found && git_oidmap_set(names, &e->peeled, e) < 0)
143 0 0 if ((error = git_reference_lookup_resolved(&ref, repo, refname, -1)) < 0)
146 0 0 if ((error = git_reference_peel(&peeled, ref, GIT_OBJECT_ANY)) < 0)
152 0 0 if (git_oid_cmp(ref_target_out, peeled_out) != 0)
186 0 0 GIT_ERROR_CHECK_ALLOC(name);
192 0 0 if (in->tag && git_tag_dup(&name->tag, in->tag) < 0)
0 0 if (in->tag && git_tag_dup(&name->tag, in->tag) < 0)
196 0 0 GIT_ERROR_CHECK_ALLOC(name->path);
215 0 0 if (!all && !is_tag)
0 0 if (!all && !is_tag)
219 0 0 if (data->opts->pattern && (!is_tag || wildmatch(data->opts->pattern,
0 0 if (data->opts->pattern && (!is_tag || wildmatch(data->opts->pattern,
0 0 if (data->opts->pattern && (!is_tag || wildmatch(data->opts->pattern,
224 0 0 if ((error = retrieve_peeled_tag_or_object_oid(
236 0 0 if (is_annotated)
238 0 0 else if (is_tag)
243 0 0 add_to_known_names(data->repo, data->names,
262 0 0 GIT_ERROR_CHECK_ALLOC(tag);
267 0 0 if ((error = commit_name_dup(&tag->name, in->name)) < 0) {
281 0 0 if (a->depth != b->depth)
283 0 0 if (a->found_order != b->found_order)
298 0 0 while (git_pqueue_size(list) > 0) {
301 0 0 if (c->flags & best->flag_within) {
303 0 0 while (git_pqueue_size(list) > index) {
305 0 0 if (!(i->flags & best->flag_within))
309 0 0 if (index > git_pqueue_size(list))
313 0 0 for (i = 0; i < c->out_degree; i++) {
315 0 0 if ((error = git_commit_list_parse(walk, p)) < 0)
317 0 0 if (!(p->flags & SEEN))
318 0 0 if ((error = git_pqueue_insert(list, p)) < 0)
328 0 0 if (n->prio == 2 && !n->tag) {
0 0 if (n->prio == 2 && !n->tag) {
329 0 0 if (git_tag_lookup(&n->tag, repo, &n->sha1) < 0) {
335 0 0 if (n->tag && !n->name_checked) {
0 0 if (n->tag && !n->name_checked) {
336 0 0 if (!git_tag_name(n->tag)) {
349 0 0 if (n->tag)
368 0 0 if ((error = git_repository_odb__weakptr(&odb, repo)) < 0)
371 0 0 while (size < GIT_OID_HEXSZ) {
372 0 0 if ((error = git_odb_exists_prefix(&dummy, odb, oid_in, size)) == 0) {
378 0 0 if (error != GIT_EAMBIGUOUS)
402 0 0 if ((error = find_unique_abbrev_size(&size, repo, id, abbrev_size)) < 0)
411 0 0 return git_str_oom(buf) ? -1 : 0;
440 0 0 if (git_vector_init(&all_matches, MAX_CANDIDATES_TAGS, compare_pt) < 0)
443 0 0 if ((error = git_pqueue_init(&list, 0, 2, git_commit_list_time_cmp)) < 0)
452 0 0 if (n && (tags || all || n->prio == 2)) {
0 0 if (n && (tags || all || n->prio == 2)) {
0 0 if (n && (tags || all || n->prio == 2)) {
0 0 if (n && (tags || all || n->prio == 2)) {
457 0 0 if ((error = commit_name_dup(&data->result->name, n)) < 0)
463 0 0 if (!data->opts->max_candidates_tags) {
471 0 0 if ((error = git_revwalk_new(&walk, git_commit_owner(commit))) < 0)
474 0 0 if ((cmit = git_revwalk__commit_lookup(walk, git_commit_id(commit))) == NULL)
477 0 0 if ((error = git_commit_list_parse(walk, cmit)) < 0)
482 0 0 if ((error = git_pqueue_insert(&list, cmit)) < 0)
485 0 0 while (git_pqueue_size(&list) > 0)
494 0 0 if (n) {
495 0 0 if (!tags && !all && n->prio < 2) {
0 0 if (!tags && !all && n->prio < 2) {
0 0 if (!tags && !all && n->prio < 2) {
497 0 0 } else if (match_cnt < data->opts->max_candidates_tags) {
499 0 0 GIT_ERROR_CHECK_ALLOC(t);
500 0 0 if ((error = git_vector_insert(&all_matches, t)) < 0)
510 0 0 if (n->prio == 2)
519 0 0 for (cur_match = 0; cur_match < match_cnt; cur_match++) {
521 0 0 if (!(c->flags & t->flag_within))
525 0 0 if (annotated_cnt && (git_pqueue_size(&list) == 0)) {
0 0 if (annotated_cnt && (git_pqueue_size(&list) == 0)) {
536 0 0 for (i = 0; i < c->out_degree; i++) {
538 0 0 if ((error = git_commit_list_parse(walk, p)) < 0)
540 0 0 if (!(p->flags & SEEN))
541 0 0 if ((error = git_pqueue_insert(&list, p)) < 0)
545 0 0 if (data->opts->only_follow_first_parent)
550 0 0 if (!match_cnt) {
551 0 0 if (data->opts->show_commit_oid_as_fallback) {
557 0 0 if (unannotated_cnt) {
576 0 0 if (gave_up_on) {
577 0 0 if ((error = git_pqueue_insert(&list, gave_up_on)) < 0)
581 0 0 if ((error = finish_depth_computation(
586 0 0 if ((error = possible_tag_dup(&data->result->tag, best)) < 0)
623 0 0 git_vector_foreach(&all_matches, i, match) {
638 0 0 if (!src) src = &default_options;
642 0 0 if (dst->max_candidates_tags > GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS)
659 0 0 GIT_ASSERT_ARG(result);
660 0 0 GIT_ASSERT_ARG(committish);
663 0 0 GIT_ERROR_CHECK_ALLOC(data.result);
668 0 0 if ((error = normalize_options(&normalized, opts)) < 0)
671 0 0 GIT_ERROR_CHECK_VERSION(
677 0 0 if ((error = git_oidmap_new(&data.names)) < 0)
682 0 0 if ((error = git_object_peel((git_object **)(&commit), committish, GIT_OBJECT_COMMIT)) < 0)
685 0 0 if ((error = git_reference_foreach_name(
690 0 0 if (git_oidmap_size(data.names) == 0 && !normalized.show_commit_oid_as_fallback) {
0 0 if (git_oidmap_size(data.names) == 0 && !normalized.show_commit_oid_as_fallback) {
697 0 0 if ((error = describe(&data, commit)) < 0)
703 0 0 git_oidmap_foreach_value(data.names, name, {
711 0 0 if (error < 0)
731 0 0 if ((error = git_reference_name_to_id(¤t_id, repo, GIT_HEAD_FILE)) < 0)
734 0 0 if ((error = git_object_lookup(&commit, repo, ¤t_id, GIT_OBJECT_COMMIT)) < 0)
738 0 0 if ((error = git_describe_commit(&result, commit, opts)) < 0)
741 0 0 if ((error = git_status_list_new(&status, repo, &status_opts)) < 0)
745 0 0 if (git_status_list_entrycount(status) > 0)
752 0 0 if (error < 0)
764 0 0 if (!src) {
783 0 0 GIT_ASSERT_ARG(out);
784 0 0 GIT_ASSERT_ARG(result);
786 0 0 GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
789 0 0 if (opts.always_use_long_format && opts.abbreviated_size == 0) {
0 0 if (opts.always_use_long_format && opts.abbreviated_size == 0) {
800 0 0 if (result->exact_match) {
802 0 0 if ((error = display_name(out, repo, name)) < 0)
805 0 0 if (opts.always_use_long_format) {
806 0 0 const git_oid *id = name->tag ? git_tag_target_id(name->tag) : &result->commit_id;
807 0 0 if ((error = show_suffix(out, 0, repo, id, opts.abbreviated_size)) < 0)
811 0 0 if (result->dirty && opts.dirty_suffix)
0 0 if (result->dirty && opts.dirty_suffix)
814 0 0 return git_str_oom(out) ? -1 : 0;
818 0 0 if (result->fallback_to_id) {
822 0 0 if ((error = find_unique_abbrev_size(
829 0 0 if (result->dirty && opts.dirty_suffix)
0 0 if (result->dirty && opts.dirty_suffix)
832 0 0 return git_str_oom(out) ? -1 : 0;
838 0 0 if ((error = display_name(out, repo, name)) < 0)
841 0 0 if (opts.abbreviated_size) {
842 0 0 if ((error = show_suffix(out, result->tag->depth, repo,
847 0 0 if (result->dirty && opts.dirty_suffix) {
0 0 if (result->dirty && opts.dirty_suffix) {
851 0 0 return git_str_oom(out) ? -1 : 0;
859 0 0 GIT_BUF_WRAP_PRIVATE(out, git_describe__format, result, given);
0 0 GIT_BUF_WRAP_PRIVATE(out, git_describe__format, result, given);
864 0 0 if (result == NULL)
867 0 0 if (result->name) {
873 0 0 if (result->tag) {
885 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
899 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(