Branch Coverage

deps/libgit2/src/libgit2/signature.c
Criterion Covered Total %
branch 63 134 47.0


line true false branch
16 187 574 if (sig == NULL)
40 200 0 return strchr(input, '<') != NULL || strchr(input, '>') != NULL;
0 200 return strchr(input, '<') != NULL || strchr(input, '>') != NULL;
45 2680 0 return c <= 32 ||
46 2680 0 c == '.' ||
47 2680 0 c == ',' ||
48 2680 0 c == ':' ||
49 2680 0 c == ';' ||
50 2680 0 c == '<' ||
51 2680 0 c == '>' ||
52 2680 0 c == '"' ||
53 2680 609 c == '\\' ||
0 2680 c == '\\' ||
59 1379 0 while (len && is_crud((unsigned char)ptr[0])) {
39 1340 while (len && is_crud((unsigned char)ptr[0])) {
63 1910 0 while (len && is_crud((unsigned char)ptr[len - 1])) {
570 1340 while (len && is_crud((unsigned char)ptr[len - 1])) {
74 0 100 GIT_ASSERT_ARG(name);
75 0 100 GIT_ASSERT_ARG(email);
86 0 100 GIT_ERROR_CHECK_ALLOC(p);
89 0 100 GIT_ERROR_CHECK_ALLOC(p->name);
91 0 100 GIT_ERROR_CHECK_ALLOC(p->email);
93 100 0 if (p->name[0] == '\0' || p->email[0] == '\0') {
0 100 if (p->name[0] == '\0' || p->email[0] == '\0') {
100 0 100 p->when.sign = (offset < 0) ? '-' : '+';
110 0 91 if (source == NULL)
114 0 91 GIT_ERROR_CHECK_ALLOC(signature);
117 0 91 GIT_ERROR_CHECK_ALLOC(signature->name);
120 0 91 GIT_ERROR_CHECK_ALLOC(signature->email);
135 0 4 if (source == NULL)
139 0 4 GIT_ERROR_CHECK_ALLOC(signature);
142 0 4 GIT_ERROR_CHECK_ALLOC(signature->name);
145 0 4 GIT_ERROR_CHECK_ALLOC(signature->email);
180 0 88 if (git_signature_new(&sig, name, email, now, (int)offset) < 0)
194 0 86 if ((error = git_repository_config_snapshot(&cfg, repo)) < 0)
197 79 7 if (!(error = git_config_get_string(&user_name, cfg, "user.name")) &&
79 0 if (!(error = git_config_get_string(&user_name, cfg, "user.name")) &&
213 531 39 if (ender &&
0 531 if (ender &&
217 531 39 if (header) {
220 531 0 if (buffer + header_len >= buffer_end || memcmp(buffer, header, header_len) != 0)
0 531 if (buffer + header_len >= buffer_end || memcmp(buffer, header, header_len) != 0)
229 570 0 if (!email_start || !email_end || email_end <= email_start)
570 0 if (!email_start || !email_end || email_end <= email_start)
0 570 if (!email_start || !email_end || email_end <= email_start)
237 570 0 if (email_end + 2 < buffer_end) {
241 0 570 if (git__strntol64(&sig->when.time, time_start,
250 570 0 if (time_end + 1 < buffer_end) {
256 570 0 if ((tz_start[0] != '-' && tz_start[0] != '+') ||
270 570 0 if (hours <= 14 && mins <= 59) {
570 0 if (hours <= 14 && mins <= 59) {
273 0 570 if (tz_start[0] == '-')
289 0 0 GIT_ASSERT_ARG(out);
290 0 0 GIT_ASSERT_ARG(buf);
295 0 0 GIT_ERROR_CHECK_ALLOC(sig);
300 0 0 if (error)
314 236 0 sign = (sig->when.offset < 0 || sig->when.sign == '-') ? '-' : '+';
0 236 sign = (sig->when.offset < 0 || sig->when.sign == '-') ? '-' : '+';
316 0 236 if (offset < 0)
322 236 0 git_str_printf(buf, "%s%s <%s> %u %c%02d%02d\n",
329 0 0 GIT_ASSERT_ARG(one);
330 0 0 GIT_ASSERT_ARG(two);
333 0 0 git__strcmp(one->name, two->name) == 0 &&
334 0 0 git__strcmp(one->email, two->email) == 0 &&
335 0 0 one->when.time == two->when.time &&
336 0 0 one->when.offset == two->when.offset &&
0 0 one->when.offset == two->when.offset &&