Branch Coverage

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


line true false branch
59 0 0 if (!e || e->prio < prio)
0 0 if (!e || e->prio < prio)
62 0 0 if (e->prio == 2 && prio == 2) {
0 0 if (e->prio == 2 && prio == 2) {
68 0 0 if (!e->tag) {
69 0 0 if (git_tag_lookup(&t, repo, &e->sha1) < 0)
74 0 0 if (git_tag_lookup(&t, repo, sha1) < 0)
79 0 0 if (e->tag->tagger)
82 0 0 if (t->tagger)
85 0 0 if (e_time < t_time)
104 0 0 if (replace_name(&tag, repo, e, prio, sha1)) {
105 0 0 if (!found) {
107 0 0 GIT_ERROR_CHECK_ALLOC(e);
113 0 0 if (e->tag)
123 0 0 if (!found && git_oidmap_set(names, &e->peeled, e) < 0)
0 0 if (!found && git_oidmap_set(names, &e->peeled, e) < 0)
142 0 0 if ((error = git_reference_lookup_resolved(&ref, repo, refname, -1)) < 0)
145 0 0 if ((error = git_reference_peel(&peeled, ref, GIT_OBJECT_ANY)) < 0)
151 0 0 if (git_oid_cmp(ref_target_out, peeled_out) != 0)
185 0 0 GIT_ERROR_CHECK_ALLOC(name);
191 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)
195 0 0 GIT_ERROR_CHECK_ALLOC(name->path);
214 0 0 if (!all && !is_tag)
0 0 if (!all && !is_tag)
218 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,
223 0 0 if ((error = retrieve_peeled_tag_or_object_oid(
235 0 0 if (is_annotated)
237 0 0 else if (is_tag)
242 0 0 add_to_known_names(data->repo, data->names,
261 0 0 GIT_ERROR_CHECK_ALLOC(tag);
266 0 0 if ((error = commit_name_dup(&tag->name, in->name)) < 0) {
280 0 0 if (a->depth != b->depth)
282 0 0 if (a->found_order != b->found_order)
297 0 0 while (git_pqueue_size(list) > 0) {
300 0 0 if (c->flags & best->flag_within) {
302 0 0 while (git_pqueue_size(list) > index) {
304 0 0 if (!(i->flags & best->flag_within))
308 0 0 if (index > git_pqueue_size(list))
312 0 0 for (i = 0; i < c->out_degree; i++) {
314 0 0 if ((error = git_commit_list_parse(walk, p)) < 0)
316 0 0 if (!(p->flags & SEEN))
317 0 0 if ((error = git_pqueue_insert(list, p)) < 0)
327 0 0 if (n->prio == 2 && !n->tag) {
0 0 if (n->prio == 2 && !n->tag) {
328 0 0 if (git_tag_lookup(&n->tag, repo, &n->sha1) < 0) {
334 0 0 if (n->tag && !n->name_checked) {
0 0 if (n->tag && !n->name_checked) {
335 0 0 if (!git_tag_name(n->tag)) {
348 0 0 if (n->tag)
367 0 0 if ((error = git_repository_odb__weakptr(&odb, repo)) < 0)
370 0 0 while (size < GIT_OID_HEXSZ) {
371 0 0 if ((error = git_odb_exists_prefix(&dummy, odb, oid_in, size)) == 0) {
377 0 0 if (error != GIT_EAMBIGUOUS)
401 0 0 if ((error = find_unique_abbrev_size(&size, repo, id, abbrev_size)) < 0)
410 0 0 return git_buf_oom(buf) ? -1 : 0;
439 0 0 if (git_vector_init(&all_matches, MAX_CANDIDATES_TAGS, compare_pt) < 0)
442 0 0 if ((error = git_pqueue_init(&list, 0, 2, git_commit_list_time_cmp)) < 0)
451 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)) {
456 0 0 if ((error = commit_name_dup(&data->result->name, n)) < 0)
462 0 0 if (!data->opts->max_candidates_tags) {
470 0 0 if ((error = git_revwalk_new(&walk, git_commit_owner(commit))) < 0)
473 0 0 if ((cmit = git_revwalk__commit_lookup(walk, git_commit_id(commit))) == NULL)
476 0 0 if ((error = git_commit_list_parse(walk, cmit)) < 0)
481 0 0 if ((error = git_pqueue_insert(&list, cmit)) < 0)
484 0 0 while (git_pqueue_size(&list) > 0)
493 0 0 if (n) {
494 0 0 if (!tags && !all && n->prio < 2) {
0 0 if (!tags && !all && n->prio < 2) {
0 0 if (!tags && !all && n->prio < 2) {
496 0 0 } else if (match_cnt < data->opts->max_candidates_tags) {
498 0 0 GIT_ERROR_CHECK_ALLOC(t);
499 0 0 if ((error = git_vector_insert(&all_matches, t)) < 0)
509 0 0 if (n->prio == 2)
518 0 0 for (cur_match = 0; cur_match < match_cnt; cur_match++) {
520 0 0 if (!(c->flags & t->flag_within))
524 0 0 if (annotated_cnt && (git_pqueue_size(&list) == 0)) {
0 0 if (annotated_cnt && (git_pqueue_size(&list) == 0)) {
535 0 0 for (i = 0; i < c->out_degree; i++) {
537 0 0 if ((error = git_commit_list_parse(walk, p)) < 0)
539 0 0 if (!(p->flags & SEEN))
540 0 0 if ((error = git_pqueue_insert(&list, p)) < 0)
544 0 0 if (data->opts->only_follow_first_parent)
549 0 0 if (!match_cnt) {
550 0 0 if (data->opts->show_commit_oid_as_fallback) {
556 0 0 if (unannotated_cnt) {
575 0 0 if (gave_up_on) {
576 0 0 if ((error = git_pqueue_insert(&list, gave_up_on)) < 0)
580 0 0 if ((error = finish_depth_computation(
585 0 0 if ((error = possible_tag_dup(&data->result->tag, best)) < 0)
622 0 0 git_vector_foreach(&all_matches, i, match) {
637 0 0 if (!src) src = &default_options;
641 0 0 if (dst->max_candidates_tags > GIT_DESCRIBE_DEFAULT_MAX_CANDIDATES_TAGS)
658 0 0 assert(committish);
661 0 0 GIT_ERROR_CHECK_ALLOC(data.result);
666 0 0 if ((error = normalize_options(&normalized, opts)) < 0)
669 0 0 GIT_ERROR_CHECK_VERSION(
675 0 0 if ((error = git_oidmap_new(&data.names)) < 0)
680 0 0 if ((error = git_object_peel((git_object **)(&commit), committish, GIT_OBJECT_COMMIT)) < 0)
683 0 0 if ((error = git_reference_foreach_name(
688 0 0 if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) {
0 0 if (git_oidmap_size(data.names) == 0 && !opts->show_commit_oid_as_fallback) {
695 0 0 if ((error = describe(&data, commit)) < 0)
701 0 0 git_oidmap_foreach_value(data.names, name, {
709 0 0 if (error < 0)
729 0 0 if ((error = git_reference_name_to_id(¤t_id, repo, GIT_HEAD_FILE)) < 0)
732 0 0 if ((error = git_object_lookup(&commit, repo, ¤t_id, GIT_OBJECT_COMMIT)) < 0)
736 0 0 if ((error = git_describe_commit(&result, commit, opts)) < 0)
739 0 0 if ((error = git_status_list_new(&status, repo, &status_opts)) < 0)
743 0 0 if (git_status_list_entrycount(status) > 0)
750 0 0 if (error < 0)
762 0 0 if (!src) {
778 0 0 assert(out && result);
0 0 assert(out && result);
780 0 0 GIT_ERROR_CHECK_VERSION(given, GIT_DESCRIBE_FORMAT_OPTIONS_VERSION, "git_describe_format_options");
786 0 0 if (opts.always_use_long_format && opts.abbreviated_size == 0) {
0 0 if (opts.always_use_long_format && opts.abbreviated_size == 0) {
797 0 0 if (result->exact_match) {
799 0 0 if ((error = display_name(out, repo, name)) < 0)
802 0 0 if (opts.always_use_long_format) {
803 0 0 const git_oid *id = name->tag ? git_tag_target_id(name->tag) : &result->commit_id;
804 0 0 if ((error = show_suffix(out, 0, repo, id, opts.abbreviated_size)) < 0)
808 0 0 if (result->dirty && opts.dirty_suffix)
0 0 if (result->dirty && opts.dirty_suffix)
811 0 0 return git_buf_oom(out) ? -1 : 0;
815 0 0 if (result->fallback_to_id) {
819 0 0 if ((error = find_unique_abbrev_size(
826 0 0 if (result->dirty && opts.dirty_suffix)
0 0 if (result->dirty && opts.dirty_suffix)
829 0 0 return git_buf_oom(out) ? -1 : 0;
835 0 0 if ((error = display_name(out, repo, name)) < 0)
838 0 0 if (opts.abbreviated_size) {
839 0 0 if ((error = show_suffix(out, result->tag->depth, repo,
844 0 0 if (result->dirty && opts.dirty_suffix) {
0 0 if (result->dirty && opts.dirty_suffix) {
848 0 0 return git_buf_oom(out) ? -1 : 0;
853 0 0 if (result == NULL)
856 0 0 if (result->name) {
862 0 0 if (result->tag) {
874 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(
886 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(