Branch Coverage

deps/libgit2/src/push.c
Criterion Covered Total %
branch 62 190 32.6


line true false branch
39 0 2 GIT_ERROR_CHECK_ALLOC(p);
46 0 2 if (git_vector_init(&p->specs, 0, push_spec_rref_cmp) < 0) {
51 0 2 if (git_vector_init(&p->status, 0, push_status_ref_cmp) < 0) {
57 0 2 if (git_vector_init(&p->updates, 0, NULL) < 0) {
70 2 0 if (!push || !opts)
0 2 if (!push || !opts)
73 0 2 GIT_ERROR_CHECK_VERSION(opts, GIT_PUSH_OPTIONS_VERSION, "git_push_options");
84 0 2 if (spec == NULL)
93 0 2 if (git__prefixcmp(ref, "refs/")) {
108 2 0 if (!error)
111 0 0 if (error == GIT_ENOTFOUND)
126 0 2 GIT_ERROR_CHECK_ALLOC(s);
128 0 2 if (git_refspec__parse(&s->refspec, str, false) < 0) {
133 2 0 if (s->refspec.src && s->refspec.src[0] != '\0' &&
138 0 2 if (check_rref(s->refspec.dst) < 0)
170 0 0 git_vector_foreach(&push->status, i, status) {
174 0 0 if (status->msg)
179 0 0 if (!fetch_spec)
185 0 0 if ((error = git_refspec_transform(&remote_ref_name, fetch_spec, status->ref)) < 0)
189 0 0 git_vector_foreach(&push->specs, j, push_spec) {
190 0 0 if (!strcmp(push_spec->refspec.dst, status->ref))
195 0 0 if (j == push->specs.length)
199 0 0 if (git_oid_is_zero(&push_spec->loid)) {
202 0 0 if (error >= 0) {
212 0 0 if (error < 0) {
213 0 0 if (error != GIT_ENOTFOUND)
220 0 0 if (fire_callback && callbacks && callbacks->update_tips) {
0 0 if (fire_callback && callbacks && callbacks->update_tips) {
0 0 if (fire_callback && callbacks && callbacks->update_tips) {
224 0 0 if (error < 0)
245 0 0 if ((error = git_object_lookup(&obj, push->repo, id, GIT_OBJECT_TAG)) < 0)
248 0 0 while (git_object_type(obj) == GIT_OBJECT_TAG) {
249 0 0 if ((error = git_packbuilder_insert(push->pb, git_object_id(obj), NULL)) < 0)
252 0 0 if ((error = git_tag_target(&target, (git_tag *) obj)) < 0)
259 0 0 if (error < 0)
275 0 2 if (git_revwalk_new(&rw, push->repo) < 0)
280 2 2 git_vector_foreach(&push->specs, i, spec) {
284 0 2 if (git_oid_is_zero(&spec->loid))
291 0 2 if (git_oid_equal(&spec->loid, &spec->roid))
294 0 2 if (git_odb_read_header(&size, &type, push->repo->_odb, &spec->loid) < 0)
297 0 2 if (type == GIT_OBJECT_TAG) {
300 0 0 if ((error = enqueue_tag(&target, push, &spec->loid)) < 0)
303 0 0 if (git_object_type(target) == GIT_OBJECT_COMMIT) {
304 0 0 if (git_revwalk_push(rw, git_object_id(target)) < 0) {
309 0 0 if (git_packbuilder_insert(
316 0 2 } else if (git_revwalk_push(rw, &spec->loid) < 0)
319 2 0 if (!spec->refspec.force) {
322 2 0 if (git_oid_is_zero(&spec->roid))
325 0 0 if (!git_odb_exists(push->repo->_odb, &spec->roid)) {
335 0 0 if (error == GIT_ENOTFOUND ||
0 0 if (error == GIT_ENOTFOUND ||
336 0 0 (!error && !git_oid_equal(&base, &spec->roid))) {
343 0 0 if (error < 0)
348 0 2 git_vector_foreach(&push->remote->refs, i, head) {
349 0 0 if (git_oid_is_zero(&head->oid))
352 0 0 if ((error = git_revwalk_hide(rw, &head->oid)) < 0 &&
0 0 if ((error = git_revwalk_hide(rw, &head->oid)) < 0 &&
353 0 0 error != GIT_ENOTFOUND && error != GIT_EINVALIDSPEC && error != GIT_EPEEL)
0 0 error != GIT_ENOTFOUND && error != GIT_EINVALIDSPEC && error != GIT_EPEEL)
367 0 2 GIT_ERROR_CHECK_ALLOC(u);
370 0 2 GIT_ERROR_CHECK_ALLOC(u->src_refname);
373 0 2 GIT_ERROR_CHECK_ALLOC(u->dst_refname);
389 2 2 git_vector_foreach(&push->specs, i, spec) {
390 2 0 if (spec->refspec.src && spec->refspec.src[0]!= '\0') {
2 0 if (spec->refspec.src && spec->refspec.src[0]!= '\0') {
392 0 2 if (git_reference_name_to_id(
400 0 2 git_vector_foreach(&push->remote->refs, j, head) {
401 0 0 if (!strcmp(spec->refspec.dst, head->name)) {
407 0 2 if (add_update(push, spec) < 0)
419 0 2 if (!transport->push) {
431 0 2 if ((error = git_packbuilder_new(&push->pb, push->repo)) < 0)
436 2 0 if (callbacks && callbacks->pack_progress)
2 0 if (callbacks && callbacks->pack_progress)
437 0 2 if ((error = git_packbuilder_set_callbacks(push->pb, callbacks->pack_progress, callbacks->payload)) < 0)
440 0 2 if ((error = calculate_work(push)) < 0)
443 2 0 if (callbacks && callbacks->push_negotiation &&
0 2 if (callbacks && callbacks->push_negotiation &&
0 0 if (callbacks && callbacks->push_negotiation &&
448 2 0 if ((error = queue_objects(push)) < 0 ||
464 0 2 if (git_remote_ls(&heads, &heads_len, remote) < 0)
467 0 2 for (i = 0; i < heads_len; i++) {
468 0 0 if (git_vector_insert(&remote->refs, (void *)heads[i]) < 0)
479 0 2 if (!git_remote_connected(push->remote) &&
0 0 if (!git_remote_connected(push->remote) &&
483 2 0 if ((error = filter_refs(push->remote)) < 0 ||
0 2 if ((error = filter_refs(push->remote)) < 0 ||
487 0 2 if (!push->unpack_ok) {
502 1 1 git_vector_foreach(&push->status, i, status) {
504 0 1 if (error)
513 0 2 if (status == NULL)
528 10 2 if (push == NULL)
531 2 2 git_vector_foreach(&push->specs, i, spec) {
536 2 2 git_vector_foreach(&push->status, i, status) {
541 2 2 git_vector_foreach(&push->updates, i, update) {
553 0 0 GIT_INIT_STRUCTURE_FROM_TEMPLATE(