Branch Coverage

deps/libgit2/src/libgit2/email.c
Criterion Covered Total %
branch 61 132 46.2


line true false branch
31 1 0 return ((!opts->subject_prefix || *opts->subject_prefix) ||
1 0 return ((!opts->subject_prefix || *opts->subject_prefix) ||
32 1 0 (opts->flags & GIT_EMAIL_CREATE_ALWAYS_NUMBER) != 0 ||
33 1 2 opts->reroll_number ||
1 0 opts->reroll_number ||
34 1 0 (patch_count > 1 && !(opts->flags & GIT_EMAIL_CREATE_OMIT_NUMBERS)));
44 1 2 opts->subject_prefix : "PATCH";
48 2 1 if (*subject_prefix)
51 0 3 if (opts->reroll_number) {
52 0 0 if (*subject_prefix)
58 3 0 if ((opts->flags & GIT_EMAIL_CREATE_ALWAYS_NUMBER) != 0 ||
2 1 if ((opts->flags & GIT_EMAIL_CREATE_ALWAYS_NUMBER) != 0 ||
59 2 0 (patch_count > 1 && !(opts->flags & GIT_EMAIL_CREATE_OMIT_NUMBERS))) {
61 0 2 opts->start_number : 1;
63 1 1 if (*subject_prefix || opts->reroll_number)
0 1 if (*subject_prefix || opts->reroll_number)
73 0 3 return git_str_oom(out) ? -1 : 0;
82 3 0 if ((error = git_str_printf(out, "Date: ")) == 0 &&
3 0 if ((error = git_str_printf(out, "Date: ")) == 0 &&
97 3 0 size_t summary_len = summary ? strlen(summary) : 0;
100 3 0 if (summary_len) {
103 0 3 if (nl)
107 0 3 if ((error = git_str_puts(out, "Subject: ")) < 0)
110 3 0 if (prefix &&
0 3 if (prefix &&
114 3 0 if (prefix && summary_len && (error = git_str_putc(out, ' ')) < 0)
3 0 if (prefix && summary_len && (error = git_str_putc(out, ' ')) < 0)
0 3 if (prefix && summary_len && (error = git_str_putc(out, ' ')) < 0)
117 3 0 if (summary_len &&
0 3 if (summary_len &&
136 3 0 if ((error = git_oid_fmt(id, commit_id)) < 0 ||
3 0 if ((error = git_oid_fmt(id, commit_id)) < 0 ||
137 3 0 (error = git_str_printf(out, "From %.*s %s\n", GIT_OID_HEXSZ, id, EMAIL_TIMESTAMP)) < 0 ||
138 3 0 (error = git_str_printf(out, "From: %s <%s>\n", author->name, author->email)) < 0 ||
139 0 3 (error = append_date(out, &author->when)) < 0 ||
143 0 3 if ((error = git_str_putc(out, '\n')) < 0)
154 3 0 if (!body)
159 0 0 if ((error = git_str_puts(out, body)) < 0)
162 0 0 if (body_len && body[body_len - 1] != '\n')
0 0 if (body_len && body[body_len - 1] != '\n')
176 3 0 if ((error = git_diff_get_stats(&stats, diff)) == 0 &&
3 0 if ((error = git_diff_get_stats(&stats, diff)) == 0 &&
191 3 3 for (i = 0; i < deltas; ++i) {
194 3 0 if ((error = git_patch_from_diff(&patch, diff, i)) >= 0)
199 0 3 if (error < 0)
220 0 3 GIT_ASSERT_ARG(out);
221 0 3 GIT_ASSERT_ARG(diff);
222 3 0 GIT_ASSERT_ARG(!patch_idx || patch_idx <= patch_count);
0 3 GIT_ASSERT_ARG(!patch_idx || patch_idx <= patch_count);
223 0 3 GIT_ASSERT_ARG(commit_id);
224 0 3 GIT_ASSERT_ARG(author);
226 0 3 GIT_ERROR_CHECK_VERSION(given_opts,
230 3 0 if (given_opts)
233 3 0 if ((error = append_header(out, patch_idx, patch_count, commit_id, summary, author, &opts)) == 0 &&
3 0 if ((error = append_header(out, patch_idx, patch_count, commit_id, summary, author, &opts)) == 0 &&
234 3 0 (error = append_body(out, body)) == 0 &&
235 3 0 (error = git_str_puts(out, "---\n")) == 0 &&
236 3 0 (error = append_diffstat(out, diff)) == 0 &&
263 3 0 if (error == 0)
285 0 0 GIT_ASSERT_ARG(out);
286 0 0 GIT_ASSERT_ARG(commit);
288 0 0 GIT_ERROR_CHECK_VERSION(given_opts,
292 0 0 if (given_opts)
303 0 0 if ((error = git_diff__commit(&diff, repo, commit, diff_opts)) < 0)
306 0 0 if ((opts.flags & GIT_EMAIL_CREATE_NO_RENAMES) == 0 &&
0 0 if ((opts.flags & GIT_EMAIL_CREATE_NO_RENAMES) == 0 &&