Branch Coverage

deps/libgit2/src/tag.c
Criterion Covered Total %
branch 51 156 32.6


line true false branch
30 0 1 assert(t);
36 0 0 assert(t);
42 0 0 assert(t);
48 0 3 assert(t);
59 0 2 assert(t);
78 0 1 if (git_oid__parse(&tag->target, &buffer, buffer_end, "object ") < 0)
81 0 1 if (buffer + 5 >= buffer_end)
84 0 1 if (memcmp(buffer, "type ", 5) != 0)
90 1 0 for (i = 1; i < ARRAY_SIZE(tag_types); ++i) {
93 0 1 if (buffer + type_length >= buffer_end)
96 1 0 if (memcmp(buffer, tag_types[i], type_length) == 0) {
103 0 1 if (tag->type == GIT_OBJECT_INVALID)
106 0 1 if (buffer + 4 >= buffer_end)
109 0 1 if (memcmp(buffer, "tag ", 4) != 0)
115 0 1 if (search == NULL)
120 0 1 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1);
0 1 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1);
122 0 1 GIT_ERROR_CHECK_ALLOC(tag->tag_name);
130 1 0 if (buffer < buffer_end && *buffer != '\n') {
1 0 if (buffer < buffer_end && *buffer != '\n') {
132 0 1 GIT_ERROR_CHECK_ALLOC(tag->tagger);
134 0 1 if (git_signature__parse(tag->tagger, &buffer, buffer_end, "tagger ", '\n') < 0)
139 1 0 if (buffer < buffer_end) {
141 0 1 if(*buffer != '\n') {
144 0 0 if (search)
152 0 1 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1);
0 1 GIT_ERROR_CHECK_ALLOC_ADD(&alloc_len, text_len, 1);
154 0 1 GIT_ERROR_CHECK_ALLOC(tag->message);
188 0 1 if (git_buf_joinpath(ref_name_out, GIT_REFS_TAGS_DIR, tag_name) < 0)
192 0 1 if (error < 0)
206 0 1 if (git_buf_joinpath(ref_name_out, GIT_REFS_TAGS_DIR, tag_name) < 0)
229 0 1 if (git_buf_puts(&tag, message) < 0)
232 0 1 if (git_repository_odb__weakptr(&odb, repo) < 0)
235 0 1 if (git_odb_write(oid, odb, tag.ptr, tag.size, GIT_OBJECT_TAG) < 0)
262 1 0 assert(repo && tag_name && target);
1 0 assert(repo && tag_name && target);
0 1 assert(repo && tag_name && target);
263 1 0 assert(!create_tag_annotation || (tagger && message));
1 0 assert(!create_tag_annotation || (tagger && message));
0 1 assert(!create_tag_annotation || (tagger && message));
265 0 1 if (git_object_owner(target) != repo) {
271 1 0 if (error < 0 && error != GIT_ENOTFOUND)
0 1 if (error < 0 && error != GIT_ENOTFOUND)
276 0 1 if (error == 0 && !allow_ref_overwrite) {
0 0 if (error == 0 && !allow_ref_overwrite) {
282 1 0 if (create_tag_annotation) {
283 0 1 if (write_tag_annotation(oid, repo, tag_name, target, tagger, message) < 0)
316 0 0 assert(oid && repo && tag_name && target && tagger && message);
0 0 assert(oid && repo && tag_name && target && tagger && message);
0 0 assert(oid && repo && tag_name && target && tagger && message);
0 0 assert(oid && repo && tag_name && target && tagger && message);
0 0 assert(oid && repo && tag_name && target && tagger && message);
0 0 assert(oid && repo && tag_name && target && tagger && message);
342 0 0 assert(oid && buffer);
0 0 assert(oid && buffer);
346 0 0 if (git_repository_odb__weakptr(&odb, repo) < 0)
350 0 0 if (tag_parse(&tag, buffer, buffer + strlen(buffer)) < 0)
354 0 0 if (git_odb_read(&target_obj, odb, &tag.target) < 0)
357 0 0 if (tag.type != target_obj->cached.type) {
363 0 0 if (error < 0 && error != GIT_ENOTFOUND)
0 0 if (error < 0 && error != GIT_ENOTFOUND)
374 0 0 if (error == 0 && !allow_ref_overwrite) {
0 0 if (error == 0 && !allow_ref_overwrite) {
380 0 0 if ((error = git_odb_open_wstream(
384 0 0 if (!(error = git_odb_stream_write(stream, buffer, strlen(buffer))))
389 0 0 if (error < 0) {
420 0 1 if (error < 0)
442 104 9 if (git__prefixcmp(ref, GIT_REFS_TAGS_DIR) != 0)
445 9 0 if (!(error = git_reference_name_to_id(&oid, d->repo, ref))) {
446 1 8 if ((error = d->cb(ref, &oid, d->cb_data)) != 0)
457 17 0 assert(repo && cb);
0 17 assert(repo && cb);
482 0 0 GIT_ERROR_CHECK_ALLOC(matched);
496 0 0 assert(tag_names && repo && pattern);
0 0 assert(tag_names && repo && pattern);
0 0 assert(tag_names && repo && pattern);
498 0 0 if ((error = git_vector_init(&taglist, 8, NULL)) < 0)
506 0 0 if (error < 0)