Branch Coverage

deps/libgit2/src/libgit2/transports/local.c
Criterion Covered Total %
branch 46 178 25.8


line true false branch
58 2 6 git_vector_foreach(heads, i, head)
74 0 2 if ((error = git_reference_lookup(&ref, t->repo, name)) < 0)
78 0 2 if (error < 0) {
80 0 0 if (!strcmp(name, GIT_HEAD_FILE) && error == GIT_ENOTFOUND) {
0 0 if (!strcmp(name, GIT_HEAD_FILE) && error == GIT_ENOTFOUND) {
93 0 2 GIT_ERROR_CHECK_ALLOC(head);
96 0 2 GIT_ERROR_CHECK_ALLOC(head->name);
100 0 2 if (git_reference_type(ref) == GIT_REFERENCE_SYMBOLIC) {
102 0 0 GIT_ERROR_CHECK_ALLOC(head->symref_target);
106 0 2 if ((error = git_vector_insert(&t->refs, head)) < 0) {
112 2 0 if (git__prefixcmp(name, GIT_REFS_TAGS_DIR))
115 0 0 if ((error = git_object_lookup(&obj, t->repo, &head->oid, GIT_OBJECT_ANY)) < 0)
122 0 0 if (git_object_type(obj) != GIT_OBJECT_TAG ||
0 0 if (git_object_type(obj) != GIT_OBJECT_TAG ||
130 0 0 GIT_ERROR_CHECK_ALLOC(head);
132 0 0 if (git_str_join(&buf, 0, name, peeled) < 0) {
138 0 0 if (!(error = git_tag_peel(&target, (git_tag *)obj))) {
141 0 0 if ((error = git_vector_insert(&t->refs, head)) < 0) {
158 0 4 GIT_ASSERT_ARG(t);
160 0 4 if (git_reference_list(&ref_names, t->repo) < 0)
164 0 4 git_vector_foreach(&t->refs, i, head) {
176 0 4 if (t->direction == GIT_DIRECTION_FETCH && add_ref(t, GIT_HEAD_FILE) < 0)
0 0 if (t->direction == GIT_DIRECTION_FETCH && add_ref(t, GIT_HEAD_FILE) < 0)
179 2 4 for (i = 0; i < ref_names.count; ++i) {
180 0 2 if (add_ref(t, ref_names.strings[i]) < 0)
210 0 4 if (t->connected)
213 0 4 if (git_remote_connect_options_normalize(&t->connect_opts, t->owner->repo, connect_opts) < 0)
219 0 4 GIT_ERROR_CHECK_ALLOC(t->url);
223 0 4 if ((error = git_fs_path_from_url_or_path(&buf, url)) < 0) {
233 0 4 if (error < 0)
238 0 4 if (store_refs(t) < 0)
252 0 0 if (!t->connected) {
273 0 2 if (!t->have_refs) {
298 0 0 git_vector_foreach(&t->refs, i, rhead) {
302 0 0 if (!error)
304 0 0 else if (error != GIT_ENOTFOUND)
325 2 0 if (lref[0] != '\0') {
331 0 0 if ((error = git_reference_lookup(&remote_ref, remote_repo, rref)) < 0) {
332 0 0 if (error == GIT_ENOTFOUND)
348 36 0 if (!cbs || !cbs->push_transfer_progress)
36 0 if (!cbs || !cbs->push_transfer_progress)
370 0 2 if ((error = git_fs_path_from_url_or_path(&buf, push->remote->url)) < 0) {
380 0 2 if (error < 0)
389 0 2 if (!remote_repo->is_bare) {
395 2 0 if ((error = git_repository__item_path(&odb_path, remote_repo, GIT_REPOSITORY_ITEM_OBJECTS)) < 0
396 2 0 || (error = git_str_joinpath(&odb_path, odb_path.ptr, "pack")) < 0)
402 0 2 if (error < 0)
407 2 2 git_vector_foreach(&push->specs, j, spec) {
413 0 2 if (!status)
417 0 2 if (!status->ref) {
437 0 0 if (last && last->message)
0 0 if (last && last->message)
445 0 2 if (error < 0 && !status->msg) {
0 0 if (error < 0 && !status->msg) {
451 0 2 if ((error = git_vector_insert(&push->status, status)) < 0) {
457 2 0 if (push->specs.length) {
460 2 0 if (!url || t->parent.close(&t->parent) < 0 ||
499 0 0 if (!t->connect_opts.callbacks.sideband_progress)
502 0 0 if (stage == GIT_PACKBUILDER_ADDING_OBJECTS) {
504 0 0 } else if (stage == GIT_PACKBUILDER_DELTAFICATION) {
507 0 0 if (current == total)
514 0 0 if (git_str_oom(&progress_info))
517 0 0 if (progress_info.size > INT_MAX) {
538 0 0 if (git_reference_type(reference) != GIT_REFERENCE_DIRECT) {
546 0 0 if (error == GIT_ENOTFOUND || error == GIT_ERROR_INVALID) {
0 0 if (error == GIT_ENOTFOUND || error == GIT_ERROR_INVALID) {
572 0 0 if ((error = git_revwalk_new(&walk, t->repo)) < 0)
577 0 0 if ((error = git_packbuilder_new(&pack, t->repo)) < 0)
587 0 0 git_vector_foreach(&t->refs, i, rhead) {
589 0 0 if ((error = git_object_lookup(&obj, t->repo, &rhead->oid, GIT_OBJECT_ANY)) < 0)
592 0 0 if (git_object_type(obj) == GIT_OBJECT_COMMIT) {
600 0 0 if (error < 0)
604 0 0 if ((error = git_reference_foreach(repo, foreach_reference_cb, walk)))
607 0 0 if ((error = git_packbuilder_insert_walk(pack, walk)))
610 0 0 if (t->connect_opts.callbacks.sideband_progress) {
611 0 0 if ((error = git_str_printf(
614 0 0 git_packbuilder_object_count(pack))) < 0 ||
623 0 0 if ((error = git_repository_odb__weakptr(&odb, repo)) < 0)
627 0 0 if (t->connect_opts.callbacks.sideband_progress) {
630 0 0 if ((error = git_str_printf(
633 0 0 git_packbuilder_object_count(pack))) < 0 ||
634 0 0 (error = git_str_putc(&progress_info, '\n')) < 0 ||
642 0 0 if ((error = git_odb_write_pack(
658 0 0 if ((error = git_packbuilder_foreach(pack, foreach_cb, &data)) != 0)
664 0 0 if (writepack) writepack->free(writepack);
691 4 2 if (t->repo) {
696 4 2 if (t->url) {
729 0 2 GIT_ERROR_CHECK_ALLOC(t);
744 0 2 if ((error = git_vector_init(&t->refs, 0, NULL)) < 0) {