Branch Coverage

deps/libgit2/src/libgit2/reflog.c
Criterion Covered Total %
branch 40 76 52.6


line true false branch
31 0 20 if (reflog == NULL)
34 20 0 if (reflog->db)
35 0 20 GIT_REFCOUNT_DEC(reflog->db, git_refdb__free);
0 0 GIT_REFCOUNT_DEC(reflog->db, git_refdb__free);
37 38 20 for (i=0; i < reflog->entries.length; i++) {
53 0 20 GIT_ASSERT_ARG(reflog);
54 0 20 GIT_ASSERT_ARG(repo);
55 0 20 GIT_ASSERT_ARG(name);
57 0 20 if ((error = git_repository_refdb__weakptr(&refdb, repo)) < 0)
67 0 4 GIT_ASSERT_ARG(reflog);
68 0 4 GIT_ASSERT_ARG(reflog->db);
79 0 3 GIT_ASSERT_ARG(reflog);
80 0 3 GIT_ASSERT_ARG(new_oid);
81 0 3 GIT_ASSERT_ARG(committer);
84 0 3 GIT_ERROR_CHECK_ALLOC(entry);
86 0 3 if ((git_signature_dup(&entry->committer, committer)) < 0)
89 3 0 if (msg != NULL) {
92 0 3 if ((entry->msg = git__strndup(msg, msglen)) == NULL)
99 24 3 for (i = 0; i < msglen; i++)
100 0 24 if (entry->msg[i] == '\n')
106 1 2 if (previous == NULL)
113 0 3 if (git_vector_insert(&reflog->entries, entry) < 0)
128 0 0 if ((error = git_repository_refdb__weakptr(&refdb, repo)) < 0)
139 0 1 if ((error = git_repository_refdb__weakptr(&refdb, repo)) < 0)
147 0 39 GIT_ASSERT_ARG_WITH_RETVAL(reflog, 0);
153 0 46 GIT_ASSERT_ARG_WITH_RETVAL(reflog, NULL);
155 1 45 if (idx >= reflog->entries.length)
164 0 3 GIT_ASSERT_ARG_WITH_RETVAL(entry, NULL);
170 0 19 GIT_ASSERT_ARG_WITH_RETVAL(entry, NULL);
176 0 16 GIT_ASSERT_ARG_WITH_RETVAL(entry, NULL);
182 0 25 GIT_ASSERT_ARG_WITH_RETVAL(entry, NULL);
195 0 4 if (entry == NULL) {
202 0 4 if (git_vector_remove(
206 0 4 if (!rewrite_previous_entry)
210 3 1 if (idx == 0)
214 0 1 if (entrycount == 1)
220 0 1 if (idx == entrycount - 1) {
222 0 0 if (git_oid_fromstr(&entry->oid_old, GIT_OID_HEX_ZERO) < 0)