Branch Coverage

deps/libgit2/src/libgit2/oid.c
Criterion Covered Total %
branch 33 100 33.0


line true false branch
36 0 1388 GIT_ASSERT_ARG(out);
37 0 1388 GIT_ASSERT_ARG(str);
39 0 1388 if (!length)
42 0 1388 if (length > GIT_OID_HEXSZ)
47 54171 1369 for (p = 0; p < length; p++) {
49 19 54152 if (v < 0)
52 27068 27084 out->id[p / 2] |= (unsigned char)(v << (p % 2 ? 0 : 4));
79 1 2652 if (!oid) {
83 88 2564 if (n > GIT_OID_HEXSZ) {
90 51739 2652 for (i = 0; i < max_i; i++)
93 51 2601 if (n & 1)
110 30039 1581 for (i = 1; i < sizeof(oid->id); i++)
126 0 7 if (!str)
134 1957 0 if (!out || n == 0)
0 1957 if (!out || n == 0)
137 0 1957 if (n > GIT_OID_HEXSZ + 1)
155 0 577 if (buffer + (header_len + sha_len + 1) > buffer_end)
158 265 312 if (memcmp(buffer, header, header_len) != 0)
161 0 312 if (buffer[header_len + sha_len] != '\n')
164 0 312 if (git_oid_fromstr(oid, buffer + header_len) < 0)
214 0 0 for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_RAWSZ; ++a) {
0 0 for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_RAWSZ; ++a) {
215 0 0 if ((hexval = git__fromhex(*str++)) < 0)
218 0 0 if (*str) {
219 0 0 if ((hexval = git__fromhex(*str++)) < 0)
223 0 0 if (*a != strval)
232 0 0 return git_oid_strcmp(oid_a, str) == 0 ? 0 : -1;
239 23625 1073 for (i = 0; i < GIT_OID_RAWSZ; ++i, ++a)
240 2158 21467 if (*a != 0)
268 0 0 GIT_ERROR_CHECK_ALLOC(self->nodes);
270 0 0 if (new_size > self->size) {
283 0 0 if (os->node_count >= os->size) {
284 0 0 if (resize_trie(os, os->size * 2) < 0)
290 0 0 if (os->node_count == SHRT_MAX) {
308 0 0 GIT_ASSERT_ARG_WITH_RETVAL((size_t)((int)min_length) == min_length, NULL);
311 0 0 if (os == NULL)
314 0 0 if (resize_trie(os, 16) < 0) {
327 0 0 if (os == NULL)
385 0 0 if (os->full) {
390 0 0 if (text_oid == NULL)
396 0 0 for (i = 0; i < GIT_OID_HEXSZ; ++i) {
400 0 0 if (c == -1) {
407 0 0 if (is_leaf) {
414 0 0 if (node == NULL) {
415 0 0 if (os->full)
421 0 0 if (node->children[c] == 0) {
422 0 0 if (push_leaf(os, idx, c, &text_oid[i + 1]) == NULL) {
423 0 0 if (os->full)
433 0 0 if (idx < 0) {
439 0 0 if (++i > os->min_length)