Branch Coverage

deps/libgit2/src/libgit2/notes.c
Criterion Covered Total %
branch 73 156 46.7


line true false branch
35 2 14 if (parent == NULL)
38 10 4 for (i = 0; i < git_tree_entrycount(parent); i++) {
41 0 10 if (!git__ishex(git_tree_entry_name(entry)))
44 0 10 if (S_ISDIR(git_tree_entry_filemode(entry))
45 0 0 && strlen(git_tree_entry_name(entry)) == 2
46 0 0 && !strncmp(git_tree_entry_name(entry), annotated_object_sha + fanout, 2))
50 10 0 if (!strcmp(git_tree_entry_name(entry), annotated_object_sha + fanout))
66 6 2 if (error == GIT_EEXISTS)
69 2 0 if (error < 0)
84 6 0 for (i=0; i
87 6 0 if (!strcmp(git_tree_entry_name(entry), target)) {
111 0 5 if ((error = git_treebuilder_new(&tb, repo, source_tree)) < 0)
114 3 2 if (object_oid) {
115 0 3 if ((error = git_treebuilder_insert(
119 0 2 if ((error = git_treebuilder_remove(tb, treeentry_name)) < 0)
123 0 5 if ((error = git_treebuilder_write(&tree_oid, tb)) < 0)
164 4 4 if (error == GIT_EEXISTS) {
170 4 0 if (error == GIT_ENOTFOUND) {
176 0 0 if (error < 0)
184 0 0 if (error < 0)
291 0 4 if ((error = git_blob_create_from_buffer(&oid, repo, note, strlen(note))) < 0)
294 1 3 if ((error = manipulate_note_in_tree_r(
1 3 if ((error = manipulate_note_in_tree_r(
300 3 0 if (notes_blob_out)
308 3 0 if (notes_commit_out)
326 0 6 GIT_ERROR_CHECK_ALLOC(note);
335 0 6 GIT_ERROR_CHECK_BLOBSIZE(blobsize);
338 0 6 GIT_ERROR_CHECK_ALLOC(note->message);
357 2 6 if ((error = find_subtree_r(&subtree, tree, repo, target, &fanout)) < 0)
360 0 6 if ((error = find_blob(&oid, subtree, target + fanout)) < 0)
363 0 6 if ((error = git_blob_lookup(&blob, repo, &oid)) < 0)
366 0 6 if ((error = note_new(¬e, &oid, commit, blob)) < 0)
388 2 2 if ((error = manipulate_note_in_tree_r(
399 0 2 if (error < 0)
402 2 0 if (notes_commit_out)
415 0 12 if ((error = git_repository_config__weakptr(&cfg, repo)) < 0)
420 12 0 if (error == GIT_ENOTFOUND)
428 7 10 if (notes_ref)
443 0 17 if ((error = normalize_namespace(notes_ref_out, repo, notes_ref)) < 0)
446 3 14 if ((error = git_reference_name_to_id(&oid, repo, notes_ref_out->ptr)) < 0)
449 0 14 if (git_commit_lookup(commit_out, repo, &oid) < 0)
467 0 8 if ((error = git_commit_tree(&tree, notes_commit)) < 0)
486 0 8 if (error < 0)
514 2 2 if (parent != NULL && (error = git_commit_tree(&tree, parent)) < 0)
0 2 if (parent != NULL && (error = git_commit_tree(&tree, parent)) < 0)
520 1 3 if (error < 0)
547 3 2 if (error < 0 && error != GIT_ENOTFOUND)
1 2 if (error < 0 && error != GIT_ENOTFOUND)
555 1 3 if (error < 0)
561 0 3 if (out != NULL)
585 0 4 if ((error = git_commit_tree(&tree, notes_commit)) < 0)
609 0 4 if (error < 0)
614 2 2 if (error < 0)
629 2 0 GIT_BUF_WRAP_PRIVATE(out, note_get_default_ref, repo);
2 0 GIT_BUF_WRAP_PRIVATE(out, note_get_default_ref, repo);
634 0 1 GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
640 0 1 GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
646 0 3 GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
652 0 3 GIT_ASSERT_ARG_WITH_RETVAL(note, NULL);
658 0 6 if (note == NULL)
675 0 0 if ((error = git_str_puts(&buf, entry_path)) < 0)
680 0 0 while (i < len) {
681 0 0 if (buf.ptr[i] == '/') {
686 0 0 if (git__fromhex(buf.ptr[i]) < 0) {
691 0 0 if (i != j)
701 0 0 if (j != GIT_OID_HEXSZ) {
723 0 0 if ((error = git_note_iterator_new(&iter, repo, notes_ref)) < 0)
726 0 0 while (!(error = git_note_next(¬e_id, &annotated_id, iter))) {
727 0 0 if ((error = note_cb(¬e_id, &annotated_id, payload)) != 0) {
733 0 0 if (error == GIT_ITEROVER)
742 0 0 if (it == NULL)
755 0 0 if ((error = git_commit_tree(&tree, notes_commit)) < 0)
758 0 0 if ((error = git_iterator_for_tree(it, tree, NULL)) < 0)
777 0 0 if (error < 0)
797 0 0 if ((error = git_iterator_current(&item, it)) < 0)
802 0 0 if ((error = process_entry_path(item->path, annotated_id)) < 0)
805 0 0 if ((error = git_iterator_advance(NULL, it)) < 0 && error != GIT_ITEROVER)
0 0 if ((error = git_iterator_advance(NULL, it)) < 0 && error != GIT_ITEROVER)