Branch Coverage

deps/libgit2/src/oid.c
Criterion Covered Total %
branch 33 110 30.0


line true false branch
29 1408 0 assert(out && str);
0 1408 assert(out && str);
31 0 1408 if (!length)
34 0 1408 if (length > GIT_OID_HEXSZ)
39 54971 1389 for (p = 0; p < length; p++) {
41 19 54952 if (v < 0)
44 27468 27484 out->id[p / 2] |= (unsigned char)(v << (p % 2 ? 0 : 4));
71 1 2671 if (!oid) {
75 106 2565 if (n > GIT_OID_HEXSZ) {
82 52119 2671 for (i = 0; i < max_i; i++)
85 51 2620 if (n & 1)
102 30210 1590 for (i = 1; i < sizeof(oid->id); i++)
118 0 7 if (!str)
126 1948 0 if (!out || n == 0)
0 1948 if (!out || n == 0)
129 0 1948 if (n > GIT_OID_HEXSZ + 1)
147 0 586 if (buffer + (header_len + sha_len + 1) > buffer_end)
150 268 318 if (memcmp(buffer, header, header_len) != 0)
153 0 318 if (buffer[header_len + sha_len] != '\n')
156 0 318 if (git_oid_fromstr(oid, buffer + header_len) < 0)
201 0 0 if (len > GIT_OID_HEXSZ)
204 0 0 while (len > 1) {
205 0 0 if (*a != *b)
212 0 0 if (len)
213 0 0 if ((*a ^ *b) & 0xf0)
225 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) {
226 0 0 if ((hexval = git__fromhex(*str++)) < 0)
229 0 0 if (*str) {
230 0 0 if ((hexval = git__fromhex(*str++)) < 0)
234 0 0 if (*a != strval)
243 0 0 return git_oid_strcmp(oid_a, str) == 0 ? 0 : -1;
250 23779 1081 for (i = 0; i < GIT_OID_RAWSZ; ++i, ++a)
251 2147 21632 if (*a != 0)
279 0 0 GIT_ERROR_CHECK_ALLOC(self->nodes);
281 0 0 if (new_size > self->size) {
294 0 0 if (os->node_count >= os->size) {
295 0 0 if (resize_trie(os, os->size * 2) < 0)
301 0 0 if (os->node_count == SHRT_MAX) {
319 0 0 assert((size_t)((int)min_length) == min_length);
322 0 0 if (os == NULL)
325 0 0 if (resize_trie(os, 16) < 0) {
338 0 0 if (os == NULL)
396 0 0 if (os->full) {
401 0 0 if (text_oid == NULL)
407 0 0 for (i = 0; i < GIT_OID_HEXSZ; ++i) {
411 0 0 if (c == -1) {
418 0 0 if (is_leaf) {
425 0 0 if (node == NULL) {
426 0 0 if (os->full)
432 0 0 if (node->children[c] == 0) {
433 0 0 if (push_leaf(os, idx, c, &text_oid[i + 1]) == NULL) {
434 0 0 if (os->full)
444 0 0 if (idx < 0) {
450 0 0 if (++i > os->min_length)