Branch Coverage

deps/libgit2/src/annotated_commit.c
Criterion Covered Total %
branch 25 70 35.7


line true false branch
29 48 0 assert(out && commit);
0 48 assert(out && commit);
34 0 48 GIT_ERROR_CHECK_ALLOC(annotated_commit);
38 0 48 if ((error = git_commit_dup(&annotated_commit->commit, commit)) < 0)
44 22 26 if (!description)
48 0 48 GIT_ERROR_CHECK_ALLOC(annotated_commit->description);
51 48 0 if (!error)
66 47 0 assert(out && repo && id);
47 0 assert(out && repo && id);
0 47 assert(out && repo && id);
70 1 46 if ((error = git_commit_lookup(&commit, repo, id)) < 0)
103 0 0 assert(out && repo && revspec);
0 0 assert(out && repo && revspec);
0 0 assert(out && repo && revspec);
105 0 0 if ((error = git_revparse_single(&obj, repo, revspec)) < 0)
108 0 0 if ((error = git_object_peel(&commit, obj, GIT_OBJECT_COMMIT))) {
129 26 0 assert(out && repo && ref);
26 0 assert(out && repo && ref);
0 26 assert(out && repo && ref);
133 0 26 if ((error = git_reference_peel(&peeled, ref, GIT_OBJECT_COMMIT)) < 0)
141 26 0 if (!error) {
143 0 26 GIT_ERROR_CHECK_ALLOC((*out)->ref_name);
157 5 0 assert(out && repo);
0 5 assert(out && repo);
161 0 5 if ((error = git_reference_lookup(&head, repo, GIT_HEAD_FILE)) < 0)
177 0 0 assert(repo && id && branch_name && remote_url);
0 0 assert(repo && id && branch_name && remote_url);
0 0 assert(repo && id && branch_name && remote_url);
0 0 assert(repo && id && branch_name && remote_url);
179 0 0 if (annotated_commit_init_from_id(out, repo, id, branch_name) < 0)
183 0 0 GIT_ERROR_CHECK_ALLOC((*out)->ref_name);
186 0 0 GIT_ERROR_CHECK_ALLOC((*out)->remote_url);
195 0 52 assert(annotated_commit);
202 0 0 assert(annotated_commit);
208 21 45 if (annotated_commit == NULL)